From 7dcb4d2f8ff3a052a7508dd6fd101c0da85a64d3 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 9 Jun 2022 11:27:33 -0500 Subject: [PATCH 01/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Model/SourceData.php | 162 ++++++++++++++++++ .../Model/StartImport.php | 147 ++++++++++++++++ .../Magento/AsynchronousImportCsv/README.md | 3 + .../AsynchronousImportCsv/composer.json | 22 +++ .../Magento/AsynchronousImportCsv/etc/di.xml | 16 ++ .../AsynchronousImportCsv/etc/module.xml | 11 ++ .../AsynchronousImportCsv/registration.php | 10 ++ .../Api/Data/SourceDataInterface.php | 73 ++++++++ .../Api/StartImportInterface.php | 36 ++++ .../AsynchronousImportCsvApi/README.md | 3 + .../AsynchronousImportCsvApi/composer.json | 21 +++ .../AsynchronousImportCsvApi/etc/module.xml | 11 ++ .../AsynchronousImportCsvApi/etc/webapi.xml | 16 ++ .../AsynchronousImportCsvApi/registration.php | 10 ++ .../Magento/ImportExport/Model/Import.php | 20 +++ composer.json | 2 + 16 files changed, 563 insertions(+) create mode 100644 app/code/Magento/AsynchronousImportCsv/Model/SourceData.php create mode 100644 app/code/Magento/AsynchronousImportCsv/Model/StartImport.php create mode 100644 app/code/Magento/AsynchronousImportCsv/README.md create mode 100644 app/code/Magento/AsynchronousImportCsv/composer.json create mode 100644 app/code/Magento/AsynchronousImportCsv/etc/di.xml create mode 100644 app/code/Magento/AsynchronousImportCsv/etc/module.xml create mode 100644 app/code/Magento/AsynchronousImportCsv/registration.php create mode 100644 app/code/Magento/AsynchronousImportCsvApi/Api/Data/SourceDataInterface.php create mode 100644 app/code/Magento/AsynchronousImportCsvApi/Api/StartImportInterface.php create mode 100644 app/code/Magento/AsynchronousImportCsvApi/README.md create mode 100644 app/code/Magento/AsynchronousImportCsvApi/composer.json create mode 100644 app/code/Magento/AsynchronousImportCsvApi/etc/module.xml create mode 100644 app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml create mode 100644 app/code/Magento/AsynchronousImportCsvApi/registration.php diff --git a/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php b/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php new file mode 100644 index 0000000000000..e6e62579ce8aa --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php @@ -0,0 +1,162 @@ +entity = $entity; + $this->behavior = $behavior; + $this->validationStrategy = $validationStrategy; + $this->allowedErrorCount = $allowedErrorCount; + $this->importFieldSeparator = $importFieldSeparator; + $this->importMultipleValueSeparator = $importMultipleValueSeparator; + $this->importEmptyAttributeValueConstant = $importEmptyAttributeValueConstant; + $this->importImagesFileDir = $importImagesFileDir; + } + + /** + * @inheritdoc + */ + public function getEntity(): string + { + return $this->entity; + } + + /** + * @inheritdoc + */ + public function getBehavior(): string + { + return $this->behavior; + } + + /** + * @inheritdoc + */ + public function getValidationStrategy(): string + { + return $this->validationStrategy; + } + + /** + * @inheritdoc + */ + public function getAllowedErrorCount(): string + { + return $this->allowedErrorCount; + } + + /** + * @inheritdoc + */ + public function getImportFieldSeparator(): string + { + return $this->importFieldSeparator; + } + + /** + * @inheritdoc + */ + public function getImportMultipleValueSeparator(): string + { + return $this->importMultipleValueSeparator; + } + + /** + * @inheritdoc + */ + public function getImportEmptyAttributeValueConstant(): string + { + return $this->importEmptyAttributeValueConstant; + } + + /** + * @inheritdoc + */ + public function getImportImagesFileDir(): string + { + return $this->importImagesFileDir; + } + + public function toArray() + { + return [ + 'entity' => $this->entity, + 'behavior' => $this->behavior, + 'validation_strategy' => $this->validationStrategy, + 'allowed_error_count' => $this->allowedErrorCount, + '_import_field_separator' => $this->importFieldSeparator, + '_import_multiple_value_separator' => $this->importMultipleValueSeparator, + '_import_empty_attribute_value_constant' => $this->importEmptyAttributeValueConstant, + 'import_images_file_dir' => $this->importImagesFileDir + ]; + } +} diff --git a/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php b/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php new file mode 100644 index 0000000000000..9ff425c77a5e0 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php @@ -0,0 +1,147 @@ +objectManager = $objectManager; + $this->imagesDirProvider = $imageDirectoryBaseProvider + ?? ObjectManager::getInstance()->get(Import\ImageDirectoryBaseProvider::class); + } + + /** + * @inheritdoc + */ + public function execute( + SourceDataInterface $source + ): array { + $source = $source->toArray(); + $import = $this->getImport()->setData($source); + $errors = []; + try { + $source = $import->uploadFileAndGetSourceForRest(); + $this->processValidationResult($import->validateSource($source), $errors); + } catch (\Magento\Framework\Exception\LocalizedException $e) { + $errors[] = $e->getMessage(); + } catch (\Exception $e) { + $errors[] ='Sorry, but the data is invalid or the file is not uploaded.'; + } + $this->getImport()->setData('images_base_directory', $this->imagesDirProvider->getDirectory()); + $errorAggregator = $this->getImport()->getErrorAggregator(); + $errorAggregator->initValidationStrategy( + $this->getImport()->getData(Import::FIELD_NAME_VALIDATION_STRATEGY), + $this->GetImport()->getData(Import::FIELD_NAME_ALLOWED_ERROR_COUNT) + ); + try { + $this->getImport()->importSource(); + } catch (\Exception $e) { + $message = $this->exceptionMessageFactory->createMessage($e); + $errors[] = $message; + } + if ($this->getImport()->getErrorAggregator()->hasToBeTerminated()) { + $errors[] ='Maximum error count has been reached or system error is occurred!'; + } else { + $this->getImport()->invalidateIndex(); + } + return $errors; + } + + /** + * Provides import model. + * + * @return Import + * @deprecated 100.1.0 + */ + private function getImport() + { + if (!$this->import) { + $this->import = $this->objectManager->get(Import::class); + } + return $this->import; + } + /** + * Process validation result and add required error or success messages to Result block + * + * @param bool $validationResult + * @param array $errors + * @return void + * @throws \Magento\Framework\Exception\LocalizedException + */ + private function processValidationResult($validationResult, $errors) + { + $import = $this->getImport(); + $errorAggregator = $import->getErrorAggregator(); + + if ($import->getProcessedRowsCount()) { + if ($validationResult) { + $this->addMessageForValidResult($errors); + } else { + $errors[] = 'Data validation failed. Please fix the following errors and upload the file again.'; + + if ($errorAggregator->getErrorsCount()) { + // $this->addMessageToSkipErrors($resultBlock); + } + } + + //$this->addErrorMessages($resultBlock, $errorAggregator); + } else { + if ($errorAggregator->getErrorsCount()) { + //$this->collectErrors($resultBlock); + } else { + //$resultBlock->addError(__('This file is empty. Please try another one.')); + } + } + } + /** + * @param array $errors + * @return void + * @throws \Magento\Framework\Exception\LocalizedException + */ + private function addMessageForValidResult($errors) + { + if ($this->getImport()->isImportAllowed()) { + $errors[]=__('File is valid! To start import process press "Import" button'); + } else { + $errors[] =__('The file is valid, but we can\'t import it for some reason.'); + } + return $errors; + } +} diff --git a/app/code/Magento/AsynchronousImportCsv/README.md b/app/code/Magento/AsynchronousImportCsv/README.md new file mode 100644 index 0000000000000..515e0a28d6ab3 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/README.md @@ -0,0 +1,3 @@ +# AsynchronousImportCsv module + +The `AsynchronousImportCsv` module provides possibility to upload CSV files as source type diff --git a/app/code/Magento/AsynchronousImportCsv/composer.json b/app/code/Magento/AsynchronousImportCsv/composer.json new file mode 100644 index 0000000000000..f3c35ed81c6da --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/composer.json @@ -0,0 +1,22 @@ +{ + "name": "magento/module-asynchronous-import-csv", + "description": "N/A", + "require": { + "php": "~7.4.0||~8.1.0", + "magento/framework": "*", + "magento/module-asynchronous-import-csv-api": "*", + }, + "type": "magento2-module", + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Magento\\AsynchronousImportCsv\\": "" + } + } +} diff --git a/app/code/Magento/AsynchronousImportCsv/etc/di.xml b/app/code/Magento/AsynchronousImportCsv/etc/di.xml new file mode 100644 index 0000000000000..2111e84e32d40 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/etc/di.xml @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/app/code/Magento/AsynchronousImportCsv/etc/module.xml b/app/code/Magento/AsynchronousImportCsv/etc/module.xml new file mode 100644 index 0000000000000..c3cd3d4f374f8 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/etc/module.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/app/code/Magento/AsynchronousImportCsv/registration.php b/app/code/Magento/AsynchronousImportCsv/registration.php new file mode 100644 index 0000000000000..955af83d92723 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/registration.php @@ -0,0 +1,10 @@ + + + + + diff --git a/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml b/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml new file mode 100644 index 0000000000000..5e2ec36c4ba0c --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/app/code/Magento/AsynchronousImportCsvApi/registration.php b/app/code/Magento/AsynchronousImportCsvApi/registration.php new file mode 100644 index 0000000000000..b1a2a26edb252 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsvApi/registration.php @@ -0,0 +1,10 @@ +getWorkingDir() . $this->getEntity() . '.csv'; + try { + $source = $this->_getSourceAdapter($sourceFile); + } catch (\Exception $e) { + $this->_varDirectory->delete($this->_varDirectory->getRelativePath($sourceFile)); + throw new LocalizedException(__($e->getMessage())); + } + + return $source; + } + /** * Remove BOM from a file * diff --git a/composer.json b/composer.json index bf8635f326f1e..3f7b9aece0246 100644 --- a/composer.json +++ b/composer.json @@ -109,6 +109,8 @@ "magento/module-amqp": "*", "magento/module-amqp-store": "*", "magento/module-analytics": "*", + "magento/module-asynchronous-import-csv": "*", + "magento/module-asynchronous-import-csv-api": "*", "magento/module-asynchronous-operations": "*", "magento/module-authorization": "*", "magento/module-advanced-search": "*", From 717beda0c010118251d9b2d04c5b5e4f36643333 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 9 Jun 2022 14:27:08 -0500 Subject: [PATCH 02/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Model/SourceData.php | 72 +------------------ .../Api/Data/SourceDataInterface.php | 27 ------- .../Magento/ImportExport/Model/Import.php | 42 ++++++++++- 3 files changed, 43 insertions(+), 98 deletions(-) diff --git a/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php b/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php index e6e62579ce8aa..5473b9fe907a8 100644 --- a/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php +++ b/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php @@ -32,54 +32,22 @@ class SourceData implements SourceDataInterface */ private $allowedErrorCount; - /** - * @var string - */ - private $importFieldSeparator; - - /** - * @var string - */ - private $importMultipleValueSeparator; - - /** - * @var string - */ - private $importEmptyAttributeValueConstant; - - /** - * @var string - */ - private $importImagesFileDir; - /** * @param string $entity * @param string $behavior * @param string $validationStrategy * @param string $allowedErrorCount - * @param string $importFieldSeparator - * @param string $importMultipleValueSeparator - * @param string $importEmptyAttributeValueConstant - * @param string $importImagesFileDir */ public function __construct( string $entity, string $behavior, string $validationStrategy, - string $allowedErrorCount, - string $importFieldSeparator, - string $importMultipleValueSeparator, - string $importEmptyAttributeValueConstant, - string $importImagesFileDir + string $allowedErrorCount ) { $this->entity = $entity; $this->behavior = $behavior; $this->validationStrategy = $validationStrategy; $this->allowedErrorCount = $allowedErrorCount; - $this->importFieldSeparator = $importFieldSeparator; - $this->importMultipleValueSeparator = $importMultipleValueSeparator; - $this->importEmptyAttributeValueConstant = $importEmptyAttributeValueConstant; - $this->importImagesFileDir = $importImagesFileDir; } /** @@ -114,49 +82,13 @@ public function getAllowedErrorCount(): string return $this->allowedErrorCount; } - /** - * @inheritdoc - */ - public function getImportFieldSeparator(): string - { - return $this->importFieldSeparator; - } - - /** - * @inheritdoc - */ - public function getImportMultipleValueSeparator(): string - { - return $this->importMultipleValueSeparator; - } - - /** - * @inheritdoc - */ - public function getImportEmptyAttributeValueConstant(): string - { - return $this->importEmptyAttributeValueConstant; - } - - /** - * @inheritdoc - */ - public function getImportImagesFileDir(): string - { - return $this->importImagesFileDir; - } - public function toArray() { return [ 'entity' => $this->entity, 'behavior' => $this->behavior, 'validation_strategy' => $this->validationStrategy, - 'allowed_error_count' => $this->allowedErrorCount, - '_import_field_separator' => $this->importFieldSeparator, - '_import_multiple_value_separator' => $this->importMultipleValueSeparator, - '_import_empty_attribute_value_constant' => $this->importEmptyAttributeValueConstant, - 'import_images_file_dir' => $this->importImagesFileDir + 'allowed_error_count' => $this->allowedErrorCount ]; } } diff --git a/app/code/Magento/AsynchronousImportCsvApi/Api/Data/SourceDataInterface.php b/app/code/Magento/AsynchronousImportCsvApi/Api/Data/SourceDataInterface.php index 88feb1fbc4b8b..93c9a5f183cf0 100644 --- a/app/code/Magento/AsynchronousImportCsvApi/Api/Data/SourceDataInterface.php +++ b/app/code/Magento/AsynchronousImportCsvApi/Api/Data/SourceDataInterface.php @@ -18,10 +18,6 @@ interface SourceDataInterface public const BEHAVIOR = 'behavior'; public const VALIDATION_STRATEGY = 'validationStrategy'; public const ALLOWED_ERROR_COUNT = 'allowedErrorCount'; - public const IMPORT_FIELD_SEPARATOR = 'importFieldSeparator'; - public const IMPORT_MULTIPLE_VALUE_SEPARATOR = 'importMultipleValueSeparator'; - public const IMPORT_EMPTY_ATTRIBUTE_VALUE_CONSTANT = 'importEmptyAttributeValueConstant'; - public const IMPORT_IMAGES_FILE_DIR = 'importImagesFileDir'; /** * @@ -47,27 +43,4 @@ public function getValidationStrategy(): string; */ public function getAllowedErrorCount(): string; - /** - * - * @return string - */ - public function getImportFieldSeparator(): string; - - /** - * - * @return string - */ - public function getImportMultipleValueSeparator(): string; - - /** - * - * @return string - */ - public function getImportEmptyAttributeValueConstant(): string; - - /** - * - * @return string - */ - public function getImportImagesFileDir(): string; } diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 0e4dc54a22a6a..a48beac1dffa9 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -196,9 +196,15 @@ class Import extends AbstractModel */ private $random; + /** + * @var \Magento\Framework\Filesystem\Io\File + */ + private $filesystemIo; + /** * @param LoggerInterface $logger * @param Filesystem $filesystem + * @param \Magento\Framework\Filesystem\Io\File $filesystemIo * @param DataHelper $importExportData * @param ScopeConfigInterface $coreConfig * @param Import\ConfigInterface $importConfig @@ -219,6 +225,7 @@ class Import extends AbstractModel public function __construct( LoggerInterface $logger, Filesystem $filesystem, + \Magento\Framework\Filesystem\Io\File $filesystemIo, DataHelper $importExportData, ScopeConfigInterface $coreConfig, ConfigInterface $importConfig, @@ -246,6 +253,7 @@ public function __construct( $this->indexerRegistry = $indexerRegistry; $this->_behaviorFactory = $behaviorFactory; $this->_filesystem = $filesystem; + $this->filesystemIo = $filesystemIo; $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; $this->messageManager = $messageManager ?: ObjectManager::getInstance() @@ -639,7 +647,39 @@ public function uploadFileAndGetSource() */ public function uploadFileAndGetSourceForRest() { - $sourceFile = $this->getWorkingDir() . $this->getEntity() . '.csv'; + $entity = $this->getEntity(); + /** @var $uploader Uploader */ + $fileName = $this->random->getRandomString(32) . '.' . 'csv'; + $uploadedFile = ''; + $extension = 'csv'; + $uploadedFile = $this->getWorkingDir() . $fileName; + + if (!$extension) { + $this->_varDirectory->delete($uploadedFile); + throw new LocalizedException(__('The file you uploaded has no extension.')); + } + $sourceFile = $this->getWorkingDir() . $entity; + + $sourceFile .= '.' . $extension; + $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); + $this->filesystemIo->cp($sourceFile, $uploadedFile); + + if (strtolower($uploadedFile) != strtolower($sourceFile)) { + if ($this->_varDirectory->isExist($sourceFileRelative)) { + $this->_varDirectory->delete($sourceFileRelative); + } + + try { + $this->_varDirectory->renameFile( + $this->_varDirectory->getRelativePath($uploadedFile), + $sourceFileRelative + ); + } catch (FileSystemException $e) { + throw new LocalizedException(__('The source file moving process failed.')); + } + } + $this->_removeBom($sourceFile); + $this->createHistoryReport($sourceFileRelative, $entity, $extension, ['name'=> $entity . 'csv']); try { $source = $this->_getSourceAdapter($sourceFile); } catch (\Exception $e) { From db09fc676d68803a12171d093b649bcdef999091 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 10 Jun 2022 12:53:38 -0500 Subject: [PATCH 03/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Magento/ImportExport/Model/Import.php | 133 ++----------- .../ImportExport/Model/Source/Upload.php | 175 ++++++++++++++++++ 2 files changed, 190 insertions(+), 118 deletions(-) create mode 100644 app/code/Magento/ImportExport/Model/Source/Upload.php diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index a48beac1dffa9..ad4fd13f463a2 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -33,6 +33,7 @@ use Magento\ImportExport\Model\ResourceModel\Import\Data; use Magento\ImportExport\Model\Source\Import\AbstractBehavior; use Magento\ImportExport\Model\Source\Import\Behavior\Factory as BehaviorFactory; +use Magento\ImportExport\Model\Source\Upload; use Magento\MediaStorage\Model\File\Uploader; use Magento\MediaStorage\Model\File\UploaderFactory; use Psr\Log\LoggerInterface; @@ -201,9 +202,15 @@ class Import extends AbstractModel */ private $filesystemIo; + /** + * @var Upload + */ + private $upload; + /** * @param LoggerInterface $logger * @param Filesystem $filesystem + * @param Upload $upload * @param \Magento\Framework\Filesystem\Io\File $filesystemIo * @param DataHelper $importExportData * @param ScopeConfigInterface $coreConfig @@ -225,6 +232,7 @@ class Import extends AbstractModel public function __construct( LoggerInterface $logger, Filesystem $filesystem, + Upload $upload, \Magento\Framework\Filesystem\Io\File $filesystemIo, DataHelper $importExportData, ScopeConfigInterface $coreConfig, @@ -256,6 +264,7 @@ public function __construct( $this->filesystemIo = $filesystemIo; $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; + $this->upload = $upload; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); $this->random = $random ?: ObjectManager::getInstance() @@ -550,74 +559,6 @@ public function getErrorAggregator() return $this->_getEntityAdapter()->getErrorAggregator(); } - /** - * Move uploaded file. - * - * @throws LocalizedException - * @return string Source file path - */ - public function uploadSource() - { - /** @var $adapter \Zend_File_Transfer_Adapter_Http */ - $adapter = $this->_httpFactory->create(); - if (!$adapter->isValid(self::FIELD_NAME_SOURCE_FILE)) { - $errors = $adapter->getErrors(); - if ($errors[0] == \Zend_Validate_File_Upload::INI_SIZE) { - $errorMessage = $this->_importExportData->getMaxUploadSizeMessage(); - } else { - $errorMessage = __('The file was not uploaded.'); - } - throw new LocalizedException($errorMessage); - } - - $entity = $this->getEntity(); - /** @var $uploader Uploader */ - $uploader = $this->_uploaderFactory->create(['fileId' => self::FIELD_NAME_SOURCE_FILE]); - $uploader->setAllowedExtensions(['csv', 'zip']); - $uploader->skipDbProcessing(true); - $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); - try { - $result = $uploader->save($this->getWorkingDir(), $fileName); - } catch (\Exception $e) { - throw new LocalizedException(__('The file cannot be uploaded.')); - } - - $extension = ''; - $uploadedFile = ''; - if ($result !== false) { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $extension = pathinfo($result['file'], PATHINFO_EXTENSION); - $uploadedFile = $result['path'] . $result['file']; - } - - if (!$extension) { - $this->_varDirectory->delete($uploadedFile); - throw new LocalizedException(__('The file you uploaded has no extension.')); - } - $sourceFile = $this->getWorkingDir() . $entity; - - $sourceFile .= '.' . $extension; - $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); - - if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($this->_varDirectory->isExist($sourceFileRelative)) { - $this->_varDirectory->delete($sourceFileRelative); - } - - try { - $this->_varDirectory->renameFile( - $this->_varDirectory->getRelativePath($uploadedFile), - $sourceFileRelative - ); - } catch (FileSystemException $e) { - throw new LocalizedException(__('The source file moving process failed.')); - } - } - $this->_removeBom($sourceFile); - $this->createHistoryReport($sourceFileRelative, $entity, $extension, $result); - return $sourceFile; - } - /** * Move uploaded file and provide source instance. * @@ -627,7 +568,7 @@ public function uploadSource() */ public function uploadFileAndGetSource() { - $sourceFile = $this->uploadSource(); + $sourceFile = $this->upload->uploadSource($this); try { $source = $this->_getSourceAdapter($sourceFile); } catch (\Exception $e) { @@ -639,55 +580,11 @@ public function uploadFileAndGetSource() } /** - * Move uploaded file and provide source instance. - * - * @return Import\AbstractSource - * @throws LocalizedException - * @since 100.2.7 + * @return Filesystem\Directory\WriteInterface */ - public function uploadFileAndGetSourceForRest() + public function getVarDirectory() { - $entity = $this->getEntity(); - /** @var $uploader Uploader */ - $fileName = $this->random->getRandomString(32) . '.' . 'csv'; - $uploadedFile = ''; - $extension = 'csv'; - $uploadedFile = $this->getWorkingDir() . $fileName; - - if (!$extension) { - $this->_varDirectory->delete($uploadedFile); - throw new LocalizedException(__('The file you uploaded has no extension.')); - } - $sourceFile = $this->getWorkingDir() . $entity; - - $sourceFile .= '.' . $extension; - $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); - $this->filesystemIo->cp($sourceFile, $uploadedFile); - - if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($this->_varDirectory->isExist($sourceFileRelative)) { - $this->_varDirectory->delete($sourceFileRelative); - } - - try { - $this->_varDirectory->renameFile( - $this->_varDirectory->getRelativePath($uploadedFile), - $sourceFileRelative - ); - } catch (FileSystemException $e) { - throw new LocalizedException(__('The source file moving process failed.')); - } - } - $this->_removeBom($sourceFile); - $this->createHistoryReport($sourceFileRelative, $entity, $extension, ['name'=> $entity . 'csv']); - try { - $source = $this->_getSourceAdapter($sourceFile); - } catch (\Exception $e) { - $this->_varDirectory->delete($this->_varDirectory->getRelativePath($sourceFile)); - throw new LocalizedException(__($e->getMessage())); - } - - return $source; + return $this->_varDirectory; } /** @@ -697,7 +594,7 @@ public function uploadFileAndGetSourceForRest() * @return $this * @throws FileSystemException */ - protected function _removeBom($sourceFile) + public function _removeBom($sourceFile) { $driver = $this->_varDirectory->getDriver(); $string = $driver->fileGetContents($this->_varDirectory->getAbsolutePath($sourceFile)); @@ -880,7 +777,7 @@ public function isReportEntityType($entity = null) * @return $this * @throws LocalizedException */ - protected function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) + public function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) { if ($this->isReportEntityType($entity)) { if (is_array($sourceFileRelative)) { diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php new file mode 100644 index 0000000000000..328a360b54047 --- /dev/null +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -0,0 +1,175 @@ +_httpFactory = $httpFactory; + $this->_importExportData = $importExportData; + $this->_uploaderFactory = $uploaderFactory; + $this->random = $random ?: ObjectManager::getInstance() + ->get(Random::class); + } + /** + * Move uploaded file. + * + * @param Import + * @throws LocalizedException + * @return string Source file path + */ + public function uploadSource(Import $import) + { + /** @var $adapter \Zend_File_Transfer_Adapter_Http */ + $adapter = $this->_httpFactory->create(); + if (!$adapter->isValid(Import::FIELD_NAME_SOURCE_FILE)) { + $errors = $adapter->getErrors(); + if ($errors[0] == \Zend_Validate_File_Upload::INI_SIZE) { + $errorMessage = $this->_importExportData->getMaxUploadSizeMessage(); + } else { + $errorMessage = __('The file was not uploaded.'); + } + throw new LocalizedException($errorMessage); + } + + $entity = $import->getEntity(); + /** @var $uploader Uploader */ + $uploader = $this->_uploaderFactory->create(['fileId' => Import::FIELD_NAME_SOURCE_FILE]); + $uploader->setAllowedExtensions(['csv', 'zip']); + $uploader->skipDbProcessing(true); + $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); + try { + $result = $uploader->save($import->getWorkingDir(), $fileName); + } catch (\Exception $e) { + throw new LocalizedException(__('The file cannot be uploaded.')); + } + + $extension = ''; + $uploadedFile = ''; + if ($result !== false) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $extension = pathinfo($result['file'], PATHINFO_EXTENSION); + $uploadedFile = $result['path'] . $result['file']; + } + + if (!$extension) { + $import->getVarDirectory()->delete($uploadedFile); + throw new LocalizedException(__('The file you uploaded has no extension.')); + } + $sourceFile = $import->getWorkingDir() . $entity; + + $sourceFile .= '.' . $extension; + $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); + + if (strtolower($uploadedFile) != strtolower($sourceFile)) { + if ($import->getVarDirectory()->isExist($sourceFileRelative)) { + $import->getVarDirectory()->delete($sourceFileRelative); + } + + try { + $import->getVarDirectory()->renameFile( + $import->getVarDirectory()->getRelativePath($uploadedFile), + $sourceFileRelative + ); + } catch (FileSystemException $e) { + throw new LocalizedException(__('The source file moving process failed.')); + } + } + $import->_removeBom($sourceFile); + $import->createHistoryReport($sourceFileRelative, $entity, $extension, $result); + return $sourceFile; + } + + /** + * Move uploaded file and provide source instance. + * + * @return Import\AbstractSource + * @throws LocalizedException + * @since 100.2.7 + */ + public function uploadFileAndGetSourceForRest() + { + $entity = $this->getEntity(); + /** @var $uploader Uploader */ + $fileName = $this->random->getRandomString(32) . '.' . 'csv'; + $uploadedFile = ''; + $extension = 'csv'; + $uploadedFile = $this->getWorkingDir() . $fileName; + + if (!$extension) { + $this->_varDirectory->delete($uploadedFile); + throw new LocalizedException(__('The file you uploaded has no extension.')); + } + $sourceFile = $this->getWorkingDir() . $entity; + + $sourceFile .= '.' . $extension; + $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); + $this->filesystemIo->cp($sourceFile, $uploadedFile); + + if (strtolower($uploadedFile) != strtolower($sourceFile)) { + if ($this->_varDirectory->isExist($sourceFileRelative)) { + $this->_varDirectory->delete($sourceFileRelative); + } + + try { + $this->_varDirectory->renameFile( + $this->_varDirectory->getRelativePath($uploadedFile), + $sourceFileRelative + ); + } catch (FileSystemException $e) { + throw new LocalizedException(__('The source file moving process failed.')); + } + } + $this->_removeBom($sourceFile); + $this->createHistoryReport($sourceFileRelative, $entity, $extension, ['name'=> $entity . 'csv']); + try { + $source = $this->_getSourceAdapter($sourceFile); + } catch (\Exception $e) { + $this->_varDirectory->delete($this->_varDirectory->getRelativePath($sourceFile)); + throw new LocalizedException(__($e->getMessage())); + } + + return $source; + } +} From 55dde4e65019c7d4b927258113dac4610882a2a2 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 10 Jun 2022 13:25:06 -0500 Subject: [PATCH 04/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Model/StartImport.php | 2 +- .../Magento/ImportExport/Model/Import.php | 43 +++++-------------- .../ImportExport/Model/Source/Upload.php | 34 ++++++++------- 3 files changed, 30 insertions(+), 49 deletions(-) diff --git a/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php b/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php index 9ff425c77a5e0..f9f9ae16ea606 100644 --- a/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php +++ b/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php @@ -57,7 +57,7 @@ public function execute( $import = $this->getImport()->setData($source); $errors = []; try { - $source = $import->uploadFileAndGetSourceForRest(); + $source = $this->import->getUpload()->uploadFileAndGetSourceForRest($import); $this->processValidationResult($import->validateSource($source), $errors); } catch (\Magento\Framework\Exception\LocalizedException $e) { $errors[] = $e->getMessage(); diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index ad4fd13f463a2..1039ad9917729 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -15,11 +15,9 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Filesystem; -use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Math\Random; use Magento\Framework\Stdlib\DateTime\DateTime; -use Magento\ImportExport\Helper\Data as DataHelper; use Magento\ImportExport\Model\Export\Adapter\CsvFactory; use Magento\ImportExport\Model\Import\AbstractEntity as ImportAbstractEntity; use Magento\ImportExport\Model\Import\AbstractSource; @@ -34,7 +32,6 @@ use Magento\ImportExport\Model\Source\Import\AbstractBehavior; use Magento\ImportExport\Model\Source\Import\Behavior\Factory as BehaviorFactory; use Magento\ImportExport\Model\Source\Upload; -use Magento\MediaStorage\Model\File\Uploader; use Magento\MediaStorage\Model\File\UploaderFactory; use Psr\Log\LoggerInterface; @@ -122,11 +119,6 @@ class Import extends AbstractModel */ protected $_entityAdapter; - /** - * @var DataHelper - */ - protected $_importExportData = null; - /** * @var \Magento\Framework\App\Config\ScopeConfigInterface */ @@ -152,11 +144,6 @@ class Import extends AbstractModel */ protected $_csvFactory; - /** - * @var FileTransferFactory - */ - protected $_httpFactory; - /** * @var UploaderFactory */ @@ -197,11 +184,6 @@ class Import extends AbstractModel */ private $random; - /** - * @var \Magento\Framework\Filesystem\Io\File - */ - private $filesystemIo; - /** * @var Upload */ @@ -211,14 +193,11 @@ class Import extends AbstractModel * @param LoggerInterface $logger * @param Filesystem $filesystem * @param Upload $upload - * @param \Magento\Framework\Filesystem\Io\File $filesystemIo - * @param DataHelper $importExportData * @param ScopeConfigInterface $coreConfig * @param Import\ConfigInterface $importConfig * @param Import\Entity\Factory $entityFactory * @param Data $importData * @param Export\Adapter\CsvFactory $csvFactory - * @param FileTransferFactory $httpFactory * @param UploaderFactory $uploaderFactory * @param Source\Import\Behavior\Factory $behaviorFactory * @param IndexerRegistry $indexerRegistry @@ -226,49 +205,39 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager - * @param Random|null $random * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( LoggerInterface $logger, Filesystem $filesystem, Upload $upload, - \Magento\Framework\Filesystem\Io\File $filesystemIo, - DataHelper $importExportData, ScopeConfigInterface $coreConfig, ConfigInterface $importConfig, Factory $entityFactory, Data $importData, CsvFactory $csvFactory, - FileTransferFactory $httpFactory, UploaderFactory $uploaderFactory, BehaviorFactory $behaviorFactory, IndexerRegistry $indexerRegistry, History $importHistoryModel, DateTime $localeDate, array $data = [], - ManagerInterface $messageManager = null, - Random $random = null + ManagerInterface $messageManager = null ) { - $this->_importExportData = $importExportData; $this->_coreConfig = $coreConfig; $this->_importConfig = $importConfig; $this->_entityFactory = $entityFactory; $this->_importData = $importData; $this->_csvFactory = $csvFactory; - $this->_httpFactory = $httpFactory; $this->_uploaderFactory = $uploaderFactory; $this->indexerRegistry = $indexerRegistry; $this->_behaviorFactory = $behaviorFactory; $this->_filesystem = $filesystem; - $this->filesystemIo = $filesystemIo; $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; $this->upload = $upload; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); - $this->random = $random ?: ObjectManager::getInstance() - ->get(Random::class); parent::__construct($logger, $filesystem, $data); } @@ -324,7 +293,7 @@ protected function _getEntityAdapter() * @return AbstractSource * @throws FileSystemException */ - protected function _getSourceAdapter($sourceFile) + public function _getSourceAdapter($sourceFile) { return Adapter::findAdapterFor( $sourceFile, @@ -840,4 +809,12 @@ public function getDeletedItemsCount() { return $this->_getEntityAdapter()->getDeletedItemsCount(); } + + /** + * @return Upload + */ + public function getUpload() + { + return $this->upload; + } } diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index 328a360b54047..9fb2d48462d33 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -5,6 +5,7 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Filesystem\Io\File; use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Math\Random; use Magento\ImportExport\Helper\Data as DataHelper; @@ -38,17 +39,20 @@ class Upload * @param FileTransferFactory $httpFactory * @param DataHelper $importExportData * @param UploaderFactory $uploaderFactory + * @param File $filesystemIo * @param Random|null $random */ public function __construct( FileTransferFactory $httpFactory, DataHelper $importExportData, UploaderFactory $uploaderFactory, + File $filesystemIo, Random $random ) { $this->_httpFactory = $httpFactory; $this->_importExportData = $importExportData; $this->_uploaderFactory = $uploaderFactory; + $this->filesystemIo = $filesystemIo; $this->random = $random ?: ObjectManager::getInstance() ->get(Random::class); } @@ -124,52 +128,52 @@ public function uploadSource(Import $import) /** * Move uploaded file and provide source instance. * + * * @param Import * @return Import\AbstractSource * @throws LocalizedException * @since 100.2.7 */ - public function uploadFileAndGetSourceForRest() + public function uploadFileAndGetSourceForRest(Import $import) { - $entity = $this->getEntity(); + $entity = $import->getEntity(); /** @var $uploader Uploader */ $fileName = $this->random->getRandomString(32) . '.' . 'csv'; $uploadedFile = ''; $extension = 'csv'; - $uploadedFile = $this->getWorkingDir() . $fileName; + $uploadedFile = $import->getWorkingDir() . $fileName; if (!$extension) { - $this->_varDirectory->delete($uploadedFile); + $import->getVarDirectory()->delete($uploadedFile); throw new LocalizedException(__('The file you uploaded has no extension.')); } - $sourceFile = $this->getWorkingDir() . $entity; + $sourceFile = $import->getWorkingDir() . $entity; $sourceFile .= '.' . $extension; - $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); + $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); $this->filesystemIo->cp($sourceFile, $uploadedFile); if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($this->_varDirectory->isExist($sourceFileRelative)) { - $this->_varDirectory->delete($sourceFileRelative); + if ($import->getVarDirectory()->isExist($sourceFileRelative)) { + $import->getVarDirectory()->delete($sourceFileRelative); } try { - $this->_varDirectory->renameFile( - $this->_varDirectory->getRelativePath($uploadedFile), + $import->getVarDirectory()->renameFile( + $import->getVarDirectory()->getRelativePath($uploadedFile), $sourceFileRelative ); } catch (FileSystemException $e) { throw new LocalizedException(__('The source file moving process failed.')); } } - $this->_removeBom($sourceFile); - $this->createHistoryReport($sourceFileRelative, $entity, $extension, ['name'=> $entity . 'csv']); + $import->_removeBom($sourceFile); + $import->createHistoryReport($sourceFileRelative, $entity, $extension, ['name'=> $entity . 'csv']); try { - $source = $this->_getSourceAdapter($sourceFile); + $source = $import->_getSourceAdapter($sourceFile); } catch (\Exception $e) { - $this->_varDirectory->delete($this->_varDirectory->getRelativePath($sourceFile)); + $import->getVarDirectory()->delete($this->_varDirectory->getRelativePath($sourceFile)); throw new LocalizedException(__($e->getMessage())); } - return $source; } } From 9bb7fe83da5fdf05ca9c5eab3e0bfad234d73371 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 15 Jun 2022 14:19:22 -0500 Subject: [PATCH 05/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Magento/ImportExport/Model/Import.php | 126 +++++++++++++----- 1 file changed, 96 insertions(+), 30 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 1039ad9917729..d087ef724788b 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -15,9 +15,11 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Filesystem; +use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Math\Random; use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\ImportExport\Helper\Data as DataHelper; use Magento\ImportExport\Model\Export\Adapter\CsvFactory; use Magento\ImportExport\Model\Import\AbstractEntity as ImportAbstractEntity; use Magento\ImportExport\Model\Import\AbstractSource; @@ -31,7 +33,7 @@ use Magento\ImportExport\Model\ResourceModel\Import\Data; use Magento\ImportExport\Model\Source\Import\AbstractBehavior; use Magento\ImportExport\Model\Source\Import\Behavior\Factory as BehaviorFactory; -use Magento\ImportExport\Model\Source\Upload; +use Magento\MediaStorage\Model\File\Uploader; use Magento\MediaStorage\Model\File\UploaderFactory; use Psr\Log\LoggerInterface; @@ -119,6 +121,11 @@ class Import extends AbstractModel */ protected $_entityAdapter; + /** + * @var DataHelper + */ + protected $_importExportData = null; + /** * @var \Magento\Framework\App\Config\ScopeConfigInterface */ @@ -144,6 +151,11 @@ class Import extends AbstractModel */ protected $_csvFactory; + /** + * @var FileTransferFactory + */ + protected $_httpFactory; + /** * @var UploaderFactory */ @@ -184,20 +196,16 @@ class Import extends AbstractModel */ private $random; - /** - * @var Upload - */ - private $upload; - /** * @param LoggerInterface $logger * @param Filesystem $filesystem - * @param Upload $upload + * @param DataHelper $importExportData * @param ScopeConfigInterface $coreConfig * @param Import\ConfigInterface $importConfig * @param Import\Entity\Factory $entityFactory * @param Data $importData * @param Export\Adapter\CsvFactory $csvFactory + * @param FileTransferFactory $httpFactory * @param UploaderFactory $uploaderFactory * @param Source\Import\Behavior\Factory $behaviorFactory * @param IndexerRegistry $indexerRegistry @@ -205,39 +213,45 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager + * @param Random|null $random * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( LoggerInterface $logger, Filesystem $filesystem, - Upload $upload, + DataHelper $importExportData, ScopeConfigInterface $coreConfig, ConfigInterface $importConfig, Factory $entityFactory, Data $importData, CsvFactory $csvFactory, + FileTransferFactory $httpFactory, UploaderFactory $uploaderFactory, BehaviorFactory $behaviorFactory, IndexerRegistry $indexerRegistry, History $importHistoryModel, DateTime $localeDate, array $data = [], - ManagerInterface $messageManager = null + ManagerInterface $messageManager = null, + Random $random = null ) { + $this->_importExportData = $importExportData; $this->_coreConfig = $coreConfig; $this->_importConfig = $importConfig; $this->_entityFactory = $entityFactory; $this->_importData = $importData; $this->_csvFactory = $csvFactory; + $this->_httpFactory = $httpFactory; $this->_uploaderFactory = $uploaderFactory; $this->indexerRegistry = $indexerRegistry; $this->_behaviorFactory = $behaviorFactory; $this->_filesystem = $filesystem; $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; - $this->upload = $upload; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); + $this->random = $random ?: ObjectManager::getInstance() + ->get(Random::class); parent::__construct($logger, $filesystem, $data); } @@ -293,7 +307,7 @@ protected function _getEntityAdapter() * @return AbstractSource * @throws FileSystemException */ - public function _getSourceAdapter($sourceFile) + protected function _getSourceAdapter($sourceFile) { return Adapter::findAdapterFor( $sourceFile, @@ -528,6 +542,74 @@ public function getErrorAggregator() return $this->_getEntityAdapter()->getErrorAggregator(); } + /** + * Move uploaded file. + * + * @throws LocalizedException + * @return string Source file path + */ + public function uploadSource() + { + /** @var $adapter \Zend_File_Transfer_Adapter_Http */ + $adapter = $this->_httpFactory->create(); + if (!$adapter->isValid(self::FIELD_NAME_SOURCE_FILE)) { + $errors = $adapter->getErrors(); + if ($errors[0] == \Zend_Validate_File_Upload::INI_SIZE) { + $errorMessage = $this->_importExportData->getMaxUploadSizeMessage(); + } else { + $errorMessage = __('The file was not uploaded.'); + } + throw new LocalizedException($errorMessage); + } + + $entity = $this->getEntity(); + /** @var $uploader Uploader */ + $uploader = $this->_uploaderFactory->create(['fileId' => self::FIELD_NAME_SOURCE_FILE]); + $uploader->setAllowedExtensions(['csv', 'zip']); + $uploader->skipDbProcessing(true); + $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); + try { + $result = $uploader->save($this->getWorkingDir(), $fileName); + } catch (\Exception $e) { + throw new LocalizedException(__('The file cannot be uploaded.')); + } + + $extension = ''; + $uploadedFile = ''; + if ($result !== false) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $extension = pathinfo($result['file'], PATHINFO_EXTENSION); + $uploadedFile = $result['path'] . $result['file']; + } + + if (!$extension) { + $this->_varDirectory->delete($uploadedFile); + throw new LocalizedException(__('The file you uploaded has no extension.')); + } + $sourceFile = $this->getWorkingDir() . $entity; + + $sourceFile .= '.' . $extension; + $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); + + if (strtolower($uploadedFile) != strtolower($sourceFile)) { + if ($this->_varDirectory->isExist($sourceFileRelative)) { + $this->_varDirectory->delete($sourceFileRelative); + } + + try { + $this->_varDirectory->renameFile( + $this->_varDirectory->getRelativePath($uploadedFile), + $sourceFileRelative + ); + } catch (FileSystemException $e) { + throw new LocalizedException(__('The source file moving process failed.')); + } + } + $this->_removeBom($sourceFile); + $this->createHistoryReport($sourceFileRelative, $entity, $extension, $result); + return $sourceFile; + } + /** * Move uploaded file and provide source instance. * @@ -537,7 +619,7 @@ public function getErrorAggregator() */ public function uploadFileAndGetSource() { - $sourceFile = $this->upload->uploadSource($this); + $sourceFile = $this->uploadSource(); try { $source = $this->_getSourceAdapter($sourceFile); } catch (\Exception $e) { @@ -548,14 +630,6 @@ public function uploadFileAndGetSource() return $source; } - /** - * @return Filesystem\Directory\WriteInterface - */ - public function getVarDirectory() - { - return $this->_varDirectory; - } - /** * Remove BOM from a file * @@ -563,7 +637,7 @@ public function getVarDirectory() * @return $this * @throws FileSystemException */ - public function _removeBom($sourceFile) + protected function _removeBom($sourceFile) { $driver = $this->_varDirectory->getDriver(); $string = $driver->fileGetContents($this->_varDirectory->getAbsolutePath($sourceFile)); @@ -746,7 +820,7 @@ public function isReportEntityType($entity = null) * @return $this * @throws LocalizedException */ - public function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) + protected function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) { if ($this->isReportEntityType($entity)) { if (is_array($sourceFileRelative)) { @@ -809,12 +883,4 @@ public function getDeletedItemsCount() { return $this->_getEntityAdapter()->getDeletedItemsCount(); } - - /** - * @return Upload - */ - public function getUpload() - { - return $this->upload; - } } From acf7ddfd0d0e3295e224f655c3f5598660389835 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 15 Jun 2022 16:05:52 -0500 Subject: [PATCH 06/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Magento/ImportExport/Model/Import.php | 126 +++++------------- 1 file changed, 30 insertions(+), 96 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index d087ef724788b..1039ad9917729 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -15,11 +15,9 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Filesystem; -use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Math\Random; use Magento\Framework\Stdlib\DateTime\DateTime; -use Magento\ImportExport\Helper\Data as DataHelper; use Magento\ImportExport\Model\Export\Adapter\CsvFactory; use Magento\ImportExport\Model\Import\AbstractEntity as ImportAbstractEntity; use Magento\ImportExport\Model\Import\AbstractSource; @@ -33,7 +31,7 @@ use Magento\ImportExport\Model\ResourceModel\Import\Data; use Magento\ImportExport\Model\Source\Import\AbstractBehavior; use Magento\ImportExport\Model\Source\Import\Behavior\Factory as BehaviorFactory; -use Magento\MediaStorage\Model\File\Uploader; +use Magento\ImportExport\Model\Source\Upload; use Magento\MediaStorage\Model\File\UploaderFactory; use Psr\Log\LoggerInterface; @@ -121,11 +119,6 @@ class Import extends AbstractModel */ protected $_entityAdapter; - /** - * @var DataHelper - */ - protected $_importExportData = null; - /** * @var \Magento\Framework\App\Config\ScopeConfigInterface */ @@ -151,11 +144,6 @@ class Import extends AbstractModel */ protected $_csvFactory; - /** - * @var FileTransferFactory - */ - protected $_httpFactory; - /** * @var UploaderFactory */ @@ -196,16 +184,20 @@ class Import extends AbstractModel */ private $random; + /** + * @var Upload + */ + private $upload; + /** * @param LoggerInterface $logger * @param Filesystem $filesystem - * @param DataHelper $importExportData + * @param Upload $upload * @param ScopeConfigInterface $coreConfig * @param Import\ConfigInterface $importConfig * @param Import\Entity\Factory $entityFactory * @param Data $importData * @param Export\Adapter\CsvFactory $csvFactory - * @param FileTransferFactory $httpFactory * @param UploaderFactory $uploaderFactory * @param Source\Import\Behavior\Factory $behaviorFactory * @param IndexerRegistry $indexerRegistry @@ -213,45 +205,39 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager - * @param Random|null $random * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( LoggerInterface $logger, Filesystem $filesystem, - DataHelper $importExportData, + Upload $upload, ScopeConfigInterface $coreConfig, ConfigInterface $importConfig, Factory $entityFactory, Data $importData, CsvFactory $csvFactory, - FileTransferFactory $httpFactory, UploaderFactory $uploaderFactory, BehaviorFactory $behaviorFactory, IndexerRegistry $indexerRegistry, History $importHistoryModel, DateTime $localeDate, array $data = [], - ManagerInterface $messageManager = null, - Random $random = null + ManagerInterface $messageManager = null ) { - $this->_importExportData = $importExportData; $this->_coreConfig = $coreConfig; $this->_importConfig = $importConfig; $this->_entityFactory = $entityFactory; $this->_importData = $importData; $this->_csvFactory = $csvFactory; - $this->_httpFactory = $httpFactory; $this->_uploaderFactory = $uploaderFactory; $this->indexerRegistry = $indexerRegistry; $this->_behaviorFactory = $behaviorFactory; $this->_filesystem = $filesystem; $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; + $this->upload = $upload; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); - $this->random = $random ?: ObjectManager::getInstance() - ->get(Random::class); parent::__construct($logger, $filesystem, $data); } @@ -307,7 +293,7 @@ protected function _getEntityAdapter() * @return AbstractSource * @throws FileSystemException */ - protected function _getSourceAdapter($sourceFile) + public function _getSourceAdapter($sourceFile) { return Adapter::findAdapterFor( $sourceFile, @@ -542,74 +528,6 @@ public function getErrorAggregator() return $this->_getEntityAdapter()->getErrorAggregator(); } - /** - * Move uploaded file. - * - * @throws LocalizedException - * @return string Source file path - */ - public function uploadSource() - { - /** @var $adapter \Zend_File_Transfer_Adapter_Http */ - $adapter = $this->_httpFactory->create(); - if (!$adapter->isValid(self::FIELD_NAME_SOURCE_FILE)) { - $errors = $adapter->getErrors(); - if ($errors[0] == \Zend_Validate_File_Upload::INI_SIZE) { - $errorMessage = $this->_importExportData->getMaxUploadSizeMessage(); - } else { - $errorMessage = __('The file was not uploaded.'); - } - throw new LocalizedException($errorMessage); - } - - $entity = $this->getEntity(); - /** @var $uploader Uploader */ - $uploader = $this->_uploaderFactory->create(['fileId' => self::FIELD_NAME_SOURCE_FILE]); - $uploader->setAllowedExtensions(['csv', 'zip']); - $uploader->skipDbProcessing(true); - $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); - try { - $result = $uploader->save($this->getWorkingDir(), $fileName); - } catch (\Exception $e) { - throw new LocalizedException(__('The file cannot be uploaded.')); - } - - $extension = ''; - $uploadedFile = ''; - if ($result !== false) { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $extension = pathinfo($result['file'], PATHINFO_EXTENSION); - $uploadedFile = $result['path'] . $result['file']; - } - - if (!$extension) { - $this->_varDirectory->delete($uploadedFile); - throw new LocalizedException(__('The file you uploaded has no extension.')); - } - $sourceFile = $this->getWorkingDir() . $entity; - - $sourceFile .= '.' . $extension; - $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); - - if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($this->_varDirectory->isExist($sourceFileRelative)) { - $this->_varDirectory->delete($sourceFileRelative); - } - - try { - $this->_varDirectory->renameFile( - $this->_varDirectory->getRelativePath($uploadedFile), - $sourceFileRelative - ); - } catch (FileSystemException $e) { - throw new LocalizedException(__('The source file moving process failed.')); - } - } - $this->_removeBom($sourceFile); - $this->createHistoryReport($sourceFileRelative, $entity, $extension, $result); - return $sourceFile; - } - /** * Move uploaded file and provide source instance. * @@ -619,7 +537,7 @@ public function uploadSource() */ public function uploadFileAndGetSource() { - $sourceFile = $this->uploadSource(); + $sourceFile = $this->upload->uploadSource($this); try { $source = $this->_getSourceAdapter($sourceFile); } catch (\Exception $e) { @@ -630,6 +548,14 @@ public function uploadFileAndGetSource() return $source; } + /** + * @return Filesystem\Directory\WriteInterface + */ + public function getVarDirectory() + { + return $this->_varDirectory; + } + /** * Remove BOM from a file * @@ -637,7 +563,7 @@ public function uploadFileAndGetSource() * @return $this * @throws FileSystemException */ - protected function _removeBom($sourceFile) + public function _removeBom($sourceFile) { $driver = $this->_varDirectory->getDriver(); $string = $driver->fileGetContents($this->_varDirectory->getAbsolutePath($sourceFile)); @@ -820,7 +746,7 @@ public function isReportEntityType($entity = null) * @return $this * @throws LocalizedException */ - protected function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) + public function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) { if ($this->isReportEntityType($entity)) { if (is_array($sourceFileRelative)) { @@ -883,4 +809,12 @@ public function getDeletedItemsCount() { return $this->_getEntityAdapter()->getDeletedItemsCount(); } + + /** + * @return Upload + */ + public function getUpload() + { + return $this->upload; + } } From a2666f6e74b5253f810ce9b71b2f50deca316456 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 15 Jun 2022 16:14:59 -0500 Subject: [PATCH 07/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint -Revert all commits --- .../Model/SourceData.php | 94 --------- .../Model/StartImport.php | 147 -------------- .../Magento/AsynchronousImportCsv/README.md | 3 - .../AsynchronousImportCsv/composer.json | 22 --- .../Magento/AsynchronousImportCsv/etc/di.xml | 16 -- .../AsynchronousImportCsv/etc/module.xml | 11 -- .../AsynchronousImportCsv/registration.php | 10 - .../Api/Data/SourceDataInterface.php | 46 ----- .../Api/StartImportInterface.php | 36 ---- .../AsynchronousImportCsvApi/README.md | 3 - .../AsynchronousImportCsvApi/composer.json | 21 -- .../AsynchronousImportCsvApi/etc/module.xml | 11 -- .../AsynchronousImportCsvApi/etc/webapi.xml | 16 -- .../AsynchronousImportCsvApi/registration.php | 10 - .../Magento/ImportExport/Model/Import.php | 126 +++++++++--- .../ImportExport/Model/Source/Upload.php | 179 ------------------ composer.json | 2 - 17 files changed, 96 insertions(+), 657 deletions(-) delete mode 100644 app/code/Magento/AsynchronousImportCsv/Model/SourceData.php delete mode 100644 app/code/Magento/AsynchronousImportCsv/Model/StartImport.php delete mode 100644 app/code/Magento/AsynchronousImportCsv/README.md delete mode 100644 app/code/Magento/AsynchronousImportCsv/composer.json delete mode 100644 app/code/Magento/AsynchronousImportCsv/etc/di.xml delete mode 100644 app/code/Magento/AsynchronousImportCsv/etc/module.xml delete mode 100644 app/code/Magento/AsynchronousImportCsv/registration.php delete mode 100644 app/code/Magento/AsynchronousImportCsvApi/Api/Data/SourceDataInterface.php delete mode 100644 app/code/Magento/AsynchronousImportCsvApi/Api/StartImportInterface.php delete mode 100644 app/code/Magento/AsynchronousImportCsvApi/README.md delete mode 100644 app/code/Magento/AsynchronousImportCsvApi/composer.json delete mode 100644 app/code/Magento/AsynchronousImportCsvApi/etc/module.xml delete mode 100644 app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml delete mode 100644 app/code/Magento/AsynchronousImportCsvApi/registration.php delete mode 100644 app/code/Magento/ImportExport/Model/Source/Upload.php diff --git a/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php b/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php deleted file mode 100644 index 5473b9fe907a8..0000000000000 --- a/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php +++ /dev/null @@ -1,94 +0,0 @@ -entity = $entity; - $this->behavior = $behavior; - $this->validationStrategy = $validationStrategy; - $this->allowedErrorCount = $allowedErrorCount; - } - - /** - * @inheritdoc - */ - public function getEntity(): string - { - return $this->entity; - } - - /** - * @inheritdoc - */ - public function getBehavior(): string - { - return $this->behavior; - } - - /** - * @inheritdoc - */ - public function getValidationStrategy(): string - { - return $this->validationStrategy; - } - - /** - * @inheritdoc - */ - public function getAllowedErrorCount(): string - { - return $this->allowedErrorCount; - } - - public function toArray() - { - return [ - 'entity' => $this->entity, - 'behavior' => $this->behavior, - 'validation_strategy' => $this->validationStrategy, - 'allowed_error_count' => $this->allowedErrorCount - ]; - } -} diff --git a/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php b/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php deleted file mode 100644 index f9f9ae16ea606..0000000000000 --- a/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php +++ /dev/null @@ -1,147 +0,0 @@ -objectManager = $objectManager; - $this->imagesDirProvider = $imageDirectoryBaseProvider - ?? ObjectManager::getInstance()->get(Import\ImageDirectoryBaseProvider::class); - } - - /** - * @inheritdoc - */ - public function execute( - SourceDataInterface $source - ): array { - $source = $source->toArray(); - $import = $this->getImport()->setData($source); - $errors = []; - try { - $source = $this->import->getUpload()->uploadFileAndGetSourceForRest($import); - $this->processValidationResult($import->validateSource($source), $errors); - } catch (\Magento\Framework\Exception\LocalizedException $e) { - $errors[] = $e->getMessage(); - } catch (\Exception $e) { - $errors[] ='Sorry, but the data is invalid or the file is not uploaded.'; - } - $this->getImport()->setData('images_base_directory', $this->imagesDirProvider->getDirectory()); - $errorAggregator = $this->getImport()->getErrorAggregator(); - $errorAggregator->initValidationStrategy( - $this->getImport()->getData(Import::FIELD_NAME_VALIDATION_STRATEGY), - $this->GetImport()->getData(Import::FIELD_NAME_ALLOWED_ERROR_COUNT) - ); - try { - $this->getImport()->importSource(); - } catch (\Exception $e) { - $message = $this->exceptionMessageFactory->createMessage($e); - $errors[] = $message; - } - if ($this->getImport()->getErrorAggregator()->hasToBeTerminated()) { - $errors[] ='Maximum error count has been reached or system error is occurred!'; - } else { - $this->getImport()->invalidateIndex(); - } - return $errors; - } - - /** - * Provides import model. - * - * @return Import - * @deprecated 100.1.0 - */ - private function getImport() - { - if (!$this->import) { - $this->import = $this->objectManager->get(Import::class); - } - return $this->import; - } - /** - * Process validation result and add required error or success messages to Result block - * - * @param bool $validationResult - * @param array $errors - * @return void - * @throws \Magento\Framework\Exception\LocalizedException - */ - private function processValidationResult($validationResult, $errors) - { - $import = $this->getImport(); - $errorAggregator = $import->getErrorAggregator(); - - if ($import->getProcessedRowsCount()) { - if ($validationResult) { - $this->addMessageForValidResult($errors); - } else { - $errors[] = 'Data validation failed. Please fix the following errors and upload the file again.'; - - if ($errorAggregator->getErrorsCount()) { - // $this->addMessageToSkipErrors($resultBlock); - } - } - - //$this->addErrorMessages($resultBlock, $errorAggregator); - } else { - if ($errorAggregator->getErrorsCount()) { - //$this->collectErrors($resultBlock); - } else { - //$resultBlock->addError(__('This file is empty. Please try another one.')); - } - } - } - /** - * @param array $errors - * @return void - * @throws \Magento\Framework\Exception\LocalizedException - */ - private function addMessageForValidResult($errors) - { - if ($this->getImport()->isImportAllowed()) { - $errors[]=__('File is valid! To start import process press "Import" button'); - } else { - $errors[] =__('The file is valid, but we can\'t import it for some reason.'); - } - return $errors; - } -} diff --git a/app/code/Magento/AsynchronousImportCsv/README.md b/app/code/Magento/AsynchronousImportCsv/README.md deleted file mode 100644 index 515e0a28d6ab3..0000000000000 --- a/app/code/Magento/AsynchronousImportCsv/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# AsynchronousImportCsv module - -The `AsynchronousImportCsv` module provides possibility to upload CSV files as source type diff --git a/app/code/Magento/AsynchronousImportCsv/composer.json b/app/code/Magento/AsynchronousImportCsv/composer.json deleted file mode 100644 index f3c35ed81c6da..0000000000000 --- a/app/code/Magento/AsynchronousImportCsv/composer.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "magento/module-asynchronous-import-csv", - "description": "N/A", - "require": { - "php": "~7.4.0||~8.1.0", - "magento/framework": "*", - "magento/module-asynchronous-import-csv-api": "*", - }, - "type": "magento2-module", - "license": [ - "OSL-3.0", - "AFL-3.0" - ], - "autoload": { - "files": [ - "registration.php" - ], - "psr-4": { - "Magento\\AsynchronousImportCsv\\": "" - } - } -} diff --git a/app/code/Magento/AsynchronousImportCsv/etc/di.xml b/app/code/Magento/AsynchronousImportCsv/etc/di.xml deleted file mode 100644 index 2111e84e32d40..0000000000000 --- a/app/code/Magento/AsynchronousImportCsv/etc/di.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - diff --git a/app/code/Magento/AsynchronousImportCsv/etc/module.xml b/app/code/Magento/AsynchronousImportCsv/etc/module.xml deleted file mode 100644 index c3cd3d4f374f8..0000000000000 --- a/app/code/Magento/AsynchronousImportCsv/etc/module.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - diff --git a/app/code/Magento/AsynchronousImportCsv/registration.php b/app/code/Magento/AsynchronousImportCsv/registration.php deleted file mode 100644 index 955af83d92723..0000000000000 --- a/app/code/Magento/AsynchronousImportCsv/registration.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml b/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml deleted file mode 100644 index 5e2ec36c4ba0c..0000000000000 --- a/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/AsynchronousImportCsvApi/registration.php b/app/code/Magento/AsynchronousImportCsvApi/registration.php deleted file mode 100644 index b1a2a26edb252..0000000000000 --- a/app/code/Magento/AsynchronousImportCsvApi/registration.php +++ /dev/null @@ -1,10 +0,0 @@ -_importExportData = $importExportData; $this->_coreConfig = $coreConfig; $this->_importConfig = $importConfig; $this->_entityFactory = $entityFactory; $this->_importData = $importData; $this->_csvFactory = $csvFactory; + $this->_httpFactory = $httpFactory; $this->_uploaderFactory = $uploaderFactory; $this->indexerRegistry = $indexerRegistry; $this->_behaviorFactory = $behaviorFactory; $this->_filesystem = $filesystem; $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; - $this->upload = $upload; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); + $this->random = $random ?: ObjectManager::getInstance() + ->get(Random::class); parent::__construct($logger, $filesystem, $data); } @@ -293,7 +307,7 @@ protected function _getEntityAdapter() * @return AbstractSource * @throws FileSystemException */ - public function _getSourceAdapter($sourceFile) + protected function _getSourceAdapter($sourceFile) { return Adapter::findAdapterFor( $sourceFile, @@ -528,6 +542,74 @@ public function getErrorAggregator() return $this->_getEntityAdapter()->getErrorAggregator(); } + /** + * Move uploaded file. + * + * @throws LocalizedException + * @return string Source file path + */ + public function uploadSource() + { + /** @var $adapter \Zend_File_Transfer_Adapter_Http */ + $adapter = $this->_httpFactory->create(); + if (!$adapter->isValid(self::FIELD_NAME_SOURCE_FILE)) { + $errors = $adapter->getErrors(); + if ($errors[0] == \Zend_Validate_File_Upload::INI_SIZE) { + $errorMessage = $this->_importExportData->getMaxUploadSizeMessage(); + } else { + $errorMessage = __('The file was not uploaded.'); + } + throw new LocalizedException($errorMessage); + } + + $entity = $this->getEntity(); + /** @var $uploader Uploader */ + $uploader = $this->_uploaderFactory->create(['fileId' => self::FIELD_NAME_SOURCE_FILE]); + $uploader->setAllowedExtensions(['csv', 'zip']); + $uploader->skipDbProcessing(true); + $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); + try { + $result = $uploader->save($this->getWorkingDir(), $fileName); + } catch (\Exception $e) { + throw new LocalizedException(__('The file cannot be uploaded.')); + } + + $extension = ''; + $uploadedFile = ''; + if ($result !== false) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $extension = pathinfo($result['file'], PATHINFO_EXTENSION); + $uploadedFile = $result['path'] . $result['file']; + } + + if (!$extension) { + $this->_varDirectory->delete($uploadedFile); + throw new LocalizedException(__('The file you uploaded has no extension.')); + } + $sourceFile = $this->getWorkingDir() . $entity; + + $sourceFile .= '.' . $extension; + $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); + + if (strtolower($uploadedFile) != strtolower($sourceFile)) { + if ($this->_varDirectory->isExist($sourceFileRelative)) { + $this->_varDirectory->delete($sourceFileRelative); + } + + try { + $this->_varDirectory->renameFile( + $this->_varDirectory->getRelativePath($uploadedFile), + $sourceFileRelative + ); + } catch (FileSystemException $e) { + throw new LocalizedException(__('The source file moving process failed.')); + } + } + $this->_removeBom($sourceFile); + $this->createHistoryReport($sourceFileRelative, $entity, $extension, $result); + return $sourceFile; + } + /** * Move uploaded file and provide source instance. * @@ -537,7 +619,7 @@ public function getErrorAggregator() */ public function uploadFileAndGetSource() { - $sourceFile = $this->upload->uploadSource($this); + $sourceFile = $this->uploadSource(); try { $source = $this->_getSourceAdapter($sourceFile); } catch (\Exception $e) { @@ -548,14 +630,6 @@ public function uploadFileAndGetSource() return $source; } - /** - * @return Filesystem\Directory\WriteInterface - */ - public function getVarDirectory() - { - return $this->_varDirectory; - } - /** * Remove BOM from a file * @@ -563,7 +637,7 @@ public function getVarDirectory() * @return $this * @throws FileSystemException */ - public function _removeBom($sourceFile) + protected function _removeBom($sourceFile) { $driver = $this->_varDirectory->getDriver(); $string = $driver->fileGetContents($this->_varDirectory->getAbsolutePath($sourceFile)); @@ -746,7 +820,7 @@ public function isReportEntityType($entity = null) * @return $this * @throws LocalizedException */ - public function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) + protected function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) { if ($this->isReportEntityType($entity)) { if (is_array($sourceFileRelative)) { @@ -809,12 +883,4 @@ public function getDeletedItemsCount() { return $this->_getEntityAdapter()->getDeletedItemsCount(); } - - /** - * @return Upload - */ - public function getUpload() - { - return $this->upload; - } } diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php deleted file mode 100644 index 9fb2d48462d33..0000000000000 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ /dev/null @@ -1,179 +0,0 @@ -_httpFactory = $httpFactory; - $this->_importExportData = $importExportData; - $this->_uploaderFactory = $uploaderFactory; - $this->filesystemIo = $filesystemIo; - $this->random = $random ?: ObjectManager::getInstance() - ->get(Random::class); - } - /** - * Move uploaded file. - * - * @param Import - * @throws LocalizedException - * @return string Source file path - */ - public function uploadSource(Import $import) - { - /** @var $adapter \Zend_File_Transfer_Adapter_Http */ - $adapter = $this->_httpFactory->create(); - if (!$adapter->isValid(Import::FIELD_NAME_SOURCE_FILE)) { - $errors = $adapter->getErrors(); - if ($errors[0] == \Zend_Validate_File_Upload::INI_SIZE) { - $errorMessage = $this->_importExportData->getMaxUploadSizeMessage(); - } else { - $errorMessage = __('The file was not uploaded.'); - } - throw new LocalizedException($errorMessage); - } - - $entity = $import->getEntity(); - /** @var $uploader Uploader */ - $uploader = $this->_uploaderFactory->create(['fileId' => Import::FIELD_NAME_SOURCE_FILE]); - $uploader->setAllowedExtensions(['csv', 'zip']); - $uploader->skipDbProcessing(true); - $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); - try { - $result = $uploader->save($import->getWorkingDir(), $fileName); - } catch (\Exception $e) { - throw new LocalizedException(__('The file cannot be uploaded.')); - } - - $extension = ''; - $uploadedFile = ''; - if ($result !== false) { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $extension = pathinfo($result['file'], PATHINFO_EXTENSION); - $uploadedFile = $result['path'] . $result['file']; - } - - if (!$extension) { - $import->getVarDirectory()->delete($uploadedFile); - throw new LocalizedException(__('The file you uploaded has no extension.')); - } - $sourceFile = $import->getWorkingDir() . $entity; - - $sourceFile .= '.' . $extension; - $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); - - if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($import->getVarDirectory()->isExist($sourceFileRelative)) { - $import->getVarDirectory()->delete($sourceFileRelative); - } - - try { - $import->getVarDirectory()->renameFile( - $import->getVarDirectory()->getRelativePath($uploadedFile), - $sourceFileRelative - ); - } catch (FileSystemException $e) { - throw new LocalizedException(__('The source file moving process failed.')); - } - } - $import->_removeBom($sourceFile); - $import->createHistoryReport($sourceFileRelative, $entity, $extension, $result); - return $sourceFile; - } - - /** - * Move uploaded file and provide source instance. - * - * * @param Import - * @return Import\AbstractSource - * @throws LocalizedException - * @since 100.2.7 - */ - public function uploadFileAndGetSourceForRest(Import $import) - { - $entity = $import->getEntity(); - /** @var $uploader Uploader */ - $fileName = $this->random->getRandomString(32) . '.' . 'csv'; - $uploadedFile = ''; - $extension = 'csv'; - $uploadedFile = $import->getWorkingDir() . $fileName; - - if (!$extension) { - $import->getVarDirectory()->delete($uploadedFile); - throw new LocalizedException(__('The file you uploaded has no extension.')); - } - $sourceFile = $import->getWorkingDir() . $entity; - - $sourceFile .= '.' . $extension; - $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); - $this->filesystemIo->cp($sourceFile, $uploadedFile); - - if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($import->getVarDirectory()->isExist($sourceFileRelative)) { - $import->getVarDirectory()->delete($sourceFileRelative); - } - - try { - $import->getVarDirectory()->renameFile( - $import->getVarDirectory()->getRelativePath($uploadedFile), - $sourceFileRelative - ); - } catch (FileSystemException $e) { - throw new LocalizedException(__('The source file moving process failed.')); - } - } - $import->_removeBom($sourceFile); - $import->createHistoryReport($sourceFileRelative, $entity, $extension, ['name'=> $entity . 'csv']); - try { - $source = $import->_getSourceAdapter($sourceFile); - } catch (\Exception $e) { - $import->getVarDirectory()->delete($this->_varDirectory->getRelativePath($sourceFile)); - throw new LocalizedException(__($e->getMessage())); - } - return $source; - } -} diff --git a/composer.json b/composer.json index 3f7b9aece0246..bf8635f326f1e 100644 --- a/composer.json +++ b/composer.json @@ -109,8 +109,6 @@ "magento/module-amqp": "*", "magento/module-amqp-store": "*", "magento/module-analytics": "*", - "magento/module-asynchronous-import-csv": "*", - "magento/module-asynchronous-import-csv-api": "*", "magento/module-asynchronous-operations": "*", "magento/module-authorization": "*", "magento/module-advanced-search": "*", From 83b9d1a44324f980c35d27bcf61c654a51927273 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 15 Jun 2022 18:16:49 -0500 Subject: [PATCH 08/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Model/SourceData.php | 94 +++++++++ .../Model/StartImport.php | 147 ++++++++++++++ .../Magento/AsynchronousImportCsv/README.md | 3 + .../AsynchronousImportCsv/composer.json | 22 +++ .../Magento/AsynchronousImportCsv/etc/di.xml | 16 ++ .../AsynchronousImportCsv/etc/module.xml | 11 ++ .../AsynchronousImportCsv/registration.php | 10 + .../Api/Data/SourceDataInterface.php | 46 +++++ .../Api/StartImportInterface.php | 36 ++++ .../AsynchronousImportCsvApi/README.md | 3 + .../AsynchronousImportCsvApi/composer.json | 21 ++ .../AsynchronousImportCsvApi/etc/module.xml | 11 ++ .../AsynchronousImportCsvApi/etc/webapi.xml | 16 ++ .../AsynchronousImportCsvApi/registration.php | 10 + .../Magento/ImportExport/Model/Import.php | 126 +++--------- .../ImportExport/Model/Source/Upload.php | 179 ++++++++++++++++++ composer.json | 2 + 17 files changed, 657 insertions(+), 96 deletions(-) create mode 100644 app/code/Magento/AsynchronousImportCsv/Model/SourceData.php create mode 100644 app/code/Magento/AsynchronousImportCsv/Model/StartImport.php create mode 100644 app/code/Magento/AsynchronousImportCsv/README.md create mode 100644 app/code/Magento/AsynchronousImportCsv/composer.json create mode 100644 app/code/Magento/AsynchronousImportCsv/etc/di.xml create mode 100644 app/code/Magento/AsynchronousImportCsv/etc/module.xml create mode 100644 app/code/Magento/AsynchronousImportCsv/registration.php create mode 100644 app/code/Magento/AsynchronousImportCsvApi/Api/Data/SourceDataInterface.php create mode 100644 app/code/Magento/AsynchronousImportCsvApi/Api/StartImportInterface.php create mode 100644 app/code/Magento/AsynchronousImportCsvApi/README.md create mode 100644 app/code/Magento/AsynchronousImportCsvApi/composer.json create mode 100644 app/code/Magento/AsynchronousImportCsvApi/etc/module.xml create mode 100644 app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml create mode 100644 app/code/Magento/AsynchronousImportCsvApi/registration.php create mode 100644 app/code/Magento/ImportExport/Model/Source/Upload.php diff --git a/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php b/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php new file mode 100644 index 0000000000000..5473b9fe907a8 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php @@ -0,0 +1,94 @@ +entity = $entity; + $this->behavior = $behavior; + $this->validationStrategy = $validationStrategy; + $this->allowedErrorCount = $allowedErrorCount; + } + + /** + * @inheritdoc + */ + public function getEntity(): string + { + return $this->entity; + } + + /** + * @inheritdoc + */ + public function getBehavior(): string + { + return $this->behavior; + } + + /** + * @inheritdoc + */ + public function getValidationStrategy(): string + { + return $this->validationStrategy; + } + + /** + * @inheritdoc + */ + public function getAllowedErrorCount(): string + { + return $this->allowedErrorCount; + } + + public function toArray() + { + return [ + 'entity' => $this->entity, + 'behavior' => $this->behavior, + 'validation_strategy' => $this->validationStrategy, + 'allowed_error_count' => $this->allowedErrorCount + ]; + } +} diff --git a/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php b/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php new file mode 100644 index 0000000000000..f9f9ae16ea606 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php @@ -0,0 +1,147 @@ +objectManager = $objectManager; + $this->imagesDirProvider = $imageDirectoryBaseProvider + ?? ObjectManager::getInstance()->get(Import\ImageDirectoryBaseProvider::class); + } + + /** + * @inheritdoc + */ + public function execute( + SourceDataInterface $source + ): array { + $source = $source->toArray(); + $import = $this->getImport()->setData($source); + $errors = []; + try { + $source = $this->import->getUpload()->uploadFileAndGetSourceForRest($import); + $this->processValidationResult($import->validateSource($source), $errors); + } catch (\Magento\Framework\Exception\LocalizedException $e) { + $errors[] = $e->getMessage(); + } catch (\Exception $e) { + $errors[] ='Sorry, but the data is invalid or the file is not uploaded.'; + } + $this->getImport()->setData('images_base_directory', $this->imagesDirProvider->getDirectory()); + $errorAggregator = $this->getImport()->getErrorAggregator(); + $errorAggregator->initValidationStrategy( + $this->getImport()->getData(Import::FIELD_NAME_VALIDATION_STRATEGY), + $this->GetImport()->getData(Import::FIELD_NAME_ALLOWED_ERROR_COUNT) + ); + try { + $this->getImport()->importSource(); + } catch (\Exception $e) { + $message = $this->exceptionMessageFactory->createMessage($e); + $errors[] = $message; + } + if ($this->getImport()->getErrorAggregator()->hasToBeTerminated()) { + $errors[] ='Maximum error count has been reached or system error is occurred!'; + } else { + $this->getImport()->invalidateIndex(); + } + return $errors; + } + + /** + * Provides import model. + * + * @return Import + * @deprecated 100.1.0 + */ + private function getImport() + { + if (!$this->import) { + $this->import = $this->objectManager->get(Import::class); + } + return $this->import; + } + /** + * Process validation result and add required error or success messages to Result block + * + * @param bool $validationResult + * @param array $errors + * @return void + * @throws \Magento\Framework\Exception\LocalizedException + */ + private function processValidationResult($validationResult, $errors) + { + $import = $this->getImport(); + $errorAggregator = $import->getErrorAggregator(); + + if ($import->getProcessedRowsCount()) { + if ($validationResult) { + $this->addMessageForValidResult($errors); + } else { + $errors[] = 'Data validation failed. Please fix the following errors and upload the file again.'; + + if ($errorAggregator->getErrorsCount()) { + // $this->addMessageToSkipErrors($resultBlock); + } + } + + //$this->addErrorMessages($resultBlock, $errorAggregator); + } else { + if ($errorAggregator->getErrorsCount()) { + //$this->collectErrors($resultBlock); + } else { + //$resultBlock->addError(__('This file is empty. Please try another one.')); + } + } + } + /** + * @param array $errors + * @return void + * @throws \Magento\Framework\Exception\LocalizedException + */ + private function addMessageForValidResult($errors) + { + if ($this->getImport()->isImportAllowed()) { + $errors[]=__('File is valid! To start import process press "Import" button'); + } else { + $errors[] =__('The file is valid, but we can\'t import it for some reason.'); + } + return $errors; + } +} diff --git a/app/code/Magento/AsynchronousImportCsv/README.md b/app/code/Magento/AsynchronousImportCsv/README.md new file mode 100644 index 0000000000000..515e0a28d6ab3 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/README.md @@ -0,0 +1,3 @@ +# AsynchronousImportCsv module + +The `AsynchronousImportCsv` module provides possibility to upload CSV files as source type diff --git a/app/code/Magento/AsynchronousImportCsv/composer.json b/app/code/Magento/AsynchronousImportCsv/composer.json new file mode 100644 index 0000000000000..f3c35ed81c6da --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/composer.json @@ -0,0 +1,22 @@ +{ + "name": "magento/module-asynchronous-import-csv", + "description": "N/A", + "require": { + "php": "~7.4.0||~8.1.0", + "magento/framework": "*", + "magento/module-asynchronous-import-csv-api": "*", + }, + "type": "magento2-module", + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Magento\\AsynchronousImportCsv\\": "" + } + } +} diff --git a/app/code/Magento/AsynchronousImportCsv/etc/di.xml b/app/code/Magento/AsynchronousImportCsv/etc/di.xml new file mode 100644 index 0000000000000..2111e84e32d40 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/etc/di.xml @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/app/code/Magento/AsynchronousImportCsv/etc/module.xml b/app/code/Magento/AsynchronousImportCsv/etc/module.xml new file mode 100644 index 0000000000000..c3cd3d4f374f8 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/etc/module.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/app/code/Magento/AsynchronousImportCsv/registration.php b/app/code/Magento/AsynchronousImportCsv/registration.php new file mode 100644 index 0000000000000..955af83d92723 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsv/registration.php @@ -0,0 +1,10 @@ + + + + + diff --git a/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml b/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml new file mode 100644 index 0000000000000..5e2ec36c4ba0c --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/app/code/Magento/AsynchronousImportCsvApi/registration.php b/app/code/Magento/AsynchronousImportCsvApi/registration.php new file mode 100644 index 0000000000000..b1a2a26edb252 --- /dev/null +++ b/app/code/Magento/AsynchronousImportCsvApi/registration.php @@ -0,0 +1,10 @@ +_importExportData = $importExportData; $this->_coreConfig = $coreConfig; $this->_importConfig = $importConfig; $this->_entityFactory = $entityFactory; $this->_importData = $importData; $this->_csvFactory = $csvFactory; - $this->_httpFactory = $httpFactory; $this->_uploaderFactory = $uploaderFactory; $this->indexerRegistry = $indexerRegistry; $this->_behaviorFactory = $behaviorFactory; $this->_filesystem = $filesystem; $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; + $this->upload = $upload; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); - $this->random = $random ?: ObjectManager::getInstance() - ->get(Random::class); parent::__construct($logger, $filesystem, $data); } @@ -307,7 +293,7 @@ protected function _getEntityAdapter() * @return AbstractSource * @throws FileSystemException */ - protected function _getSourceAdapter($sourceFile) + public function _getSourceAdapter($sourceFile) { return Adapter::findAdapterFor( $sourceFile, @@ -542,74 +528,6 @@ public function getErrorAggregator() return $this->_getEntityAdapter()->getErrorAggregator(); } - /** - * Move uploaded file. - * - * @throws LocalizedException - * @return string Source file path - */ - public function uploadSource() - { - /** @var $adapter \Zend_File_Transfer_Adapter_Http */ - $adapter = $this->_httpFactory->create(); - if (!$adapter->isValid(self::FIELD_NAME_SOURCE_FILE)) { - $errors = $adapter->getErrors(); - if ($errors[0] == \Zend_Validate_File_Upload::INI_SIZE) { - $errorMessage = $this->_importExportData->getMaxUploadSizeMessage(); - } else { - $errorMessage = __('The file was not uploaded.'); - } - throw new LocalizedException($errorMessage); - } - - $entity = $this->getEntity(); - /** @var $uploader Uploader */ - $uploader = $this->_uploaderFactory->create(['fileId' => self::FIELD_NAME_SOURCE_FILE]); - $uploader->setAllowedExtensions(['csv', 'zip']); - $uploader->skipDbProcessing(true); - $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); - try { - $result = $uploader->save($this->getWorkingDir(), $fileName); - } catch (\Exception $e) { - throw new LocalizedException(__('The file cannot be uploaded.')); - } - - $extension = ''; - $uploadedFile = ''; - if ($result !== false) { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $extension = pathinfo($result['file'], PATHINFO_EXTENSION); - $uploadedFile = $result['path'] . $result['file']; - } - - if (!$extension) { - $this->_varDirectory->delete($uploadedFile); - throw new LocalizedException(__('The file you uploaded has no extension.')); - } - $sourceFile = $this->getWorkingDir() . $entity; - - $sourceFile .= '.' . $extension; - $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); - - if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($this->_varDirectory->isExist($sourceFileRelative)) { - $this->_varDirectory->delete($sourceFileRelative); - } - - try { - $this->_varDirectory->renameFile( - $this->_varDirectory->getRelativePath($uploadedFile), - $sourceFileRelative - ); - } catch (FileSystemException $e) { - throw new LocalizedException(__('The source file moving process failed.')); - } - } - $this->_removeBom($sourceFile); - $this->createHistoryReport($sourceFileRelative, $entity, $extension, $result); - return $sourceFile; - } - /** * Move uploaded file and provide source instance. * @@ -619,7 +537,7 @@ public function uploadSource() */ public function uploadFileAndGetSource() { - $sourceFile = $this->uploadSource(); + $sourceFile = $this->upload->uploadSource($this); try { $source = $this->_getSourceAdapter($sourceFile); } catch (\Exception $e) { @@ -630,6 +548,14 @@ public function uploadFileAndGetSource() return $source; } + /** + * @return Filesystem\Directory\WriteInterface + */ + public function getVarDirectory() + { + return $this->_varDirectory; + } + /** * Remove BOM from a file * @@ -637,7 +563,7 @@ public function uploadFileAndGetSource() * @return $this * @throws FileSystemException */ - protected function _removeBom($sourceFile) + public function _removeBom($sourceFile) { $driver = $this->_varDirectory->getDriver(); $string = $driver->fileGetContents($this->_varDirectory->getAbsolutePath($sourceFile)); @@ -820,7 +746,7 @@ public function isReportEntityType($entity = null) * @return $this * @throws LocalizedException */ - protected function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) + public function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) { if ($this->isReportEntityType($entity)) { if (is_array($sourceFileRelative)) { @@ -883,4 +809,12 @@ public function getDeletedItemsCount() { return $this->_getEntityAdapter()->getDeletedItemsCount(); } + + /** + * @return Upload + */ + public function getUpload() + { + return $this->upload; + } } diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php new file mode 100644 index 0000000000000..9fb2d48462d33 --- /dev/null +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -0,0 +1,179 @@ +_httpFactory = $httpFactory; + $this->_importExportData = $importExportData; + $this->_uploaderFactory = $uploaderFactory; + $this->filesystemIo = $filesystemIo; + $this->random = $random ?: ObjectManager::getInstance() + ->get(Random::class); + } + /** + * Move uploaded file. + * + * @param Import + * @throws LocalizedException + * @return string Source file path + */ + public function uploadSource(Import $import) + { + /** @var $adapter \Zend_File_Transfer_Adapter_Http */ + $adapter = $this->_httpFactory->create(); + if (!$adapter->isValid(Import::FIELD_NAME_SOURCE_FILE)) { + $errors = $adapter->getErrors(); + if ($errors[0] == \Zend_Validate_File_Upload::INI_SIZE) { + $errorMessage = $this->_importExportData->getMaxUploadSizeMessage(); + } else { + $errorMessage = __('The file was not uploaded.'); + } + throw new LocalizedException($errorMessage); + } + + $entity = $import->getEntity(); + /** @var $uploader Uploader */ + $uploader = $this->_uploaderFactory->create(['fileId' => Import::FIELD_NAME_SOURCE_FILE]); + $uploader->setAllowedExtensions(['csv', 'zip']); + $uploader->skipDbProcessing(true); + $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); + try { + $result = $uploader->save($import->getWorkingDir(), $fileName); + } catch (\Exception $e) { + throw new LocalizedException(__('The file cannot be uploaded.')); + } + + $extension = ''; + $uploadedFile = ''; + if ($result !== false) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $extension = pathinfo($result['file'], PATHINFO_EXTENSION); + $uploadedFile = $result['path'] . $result['file']; + } + + if (!$extension) { + $import->getVarDirectory()->delete($uploadedFile); + throw new LocalizedException(__('The file you uploaded has no extension.')); + } + $sourceFile = $import->getWorkingDir() . $entity; + + $sourceFile .= '.' . $extension; + $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); + + if (strtolower($uploadedFile) != strtolower($sourceFile)) { + if ($import->getVarDirectory()->isExist($sourceFileRelative)) { + $import->getVarDirectory()->delete($sourceFileRelative); + } + + try { + $import->getVarDirectory()->renameFile( + $import->getVarDirectory()->getRelativePath($uploadedFile), + $sourceFileRelative + ); + } catch (FileSystemException $e) { + throw new LocalizedException(__('The source file moving process failed.')); + } + } + $import->_removeBom($sourceFile); + $import->createHistoryReport($sourceFileRelative, $entity, $extension, $result); + return $sourceFile; + } + + /** + * Move uploaded file and provide source instance. + * + * * @param Import + * @return Import\AbstractSource + * @throws LocalizedException + * @since 100.2.7 + */ + public function uploadFileAndGetSourceForRest(Import $import) + { + $entity = $import->getEntity(); + /** @var $uploader Uploader */ + $fileName = $this->random->getRandomString(32) . '.' . 'csv'; + $uploadedFile = ''; + $extension = 'csv'; + $uploadedFile = $import->getWorkingDir() . $fileName; + + if (!$extension) { + $import->getVarDirectory()->delete($uploadedFile); + throw new LocalizedException(__('The file you uploaded has no extension.')); + } + $sourceFile = $import->getWorkingDir() . $entity; + + $sourceFile .= '.' . $extension; + $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); + $this->filesystemIo->cp($sourceFile, $uploadedFile); + + if (strtolower($uploadedFile) != strtolower($sourceFile)) { + if ($import->getVarDirectory()->isExist($sourceFileRelative)) { + $import->getVarDirectory()->delete($sourceFileRelative); + } + + try { + $import->getVarDirectory()->renameFile( + $import->getVarDirectory()->getRelativePath($uploadedFile), + $sourceFileRelative + ); + } catch (FileSystemException $e) { + throw new LocalizedException(__('The source file moving process failed.')); + } + } + $import->_removeBom($sourceFile); + $import->createHistoryReport($sourceFileRelative, $entity, $extension, ['name'=> $entity . 'csv']); + try { + $source = $import->_getSourceAdapter($sourceFile); + } catch (\Exception $e) { + $import->getVarDirectory()->delete($this->_varDirectory->getRelativePath($sourceFile)); + throw new LocalizedException(__($e->getMessage())); + } + return $source; + } +} diff --git a/composer.json b/composer.json index bf8635f326f1e..3f7b9aece0246 100644 --- a/composer.json +++ b/composer.json @@ -109,6 +109,8 @@ "magento/module-amqp": "*", "magento/module-amqp-store": "*", "magento/module-analytics": "*", + "magento/module-asynchronous-import-csv": "*", + "magento/module-asynchronous-import-csv-api": "*", "magento/module-asynchronous-operations": "*", "magento/module-authorization": "*", "magento/module-advanced-search": "*", From 818f4f97bdc98f4a9ca23b081bc340f660583868 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 16 Jun 2022 16:12:27 -0500 Subject: [PATCH 09/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- app/code/Magento/AsynchronousImportCsv/README.md | 3 --- .../Magento/AsynchronousImportCsv/etc/di.xml | 16 ---------------- .../Magento/AsynchronousImportCsvApi/README.md | 3 --- .../Model/SourceData.php | 4 ++-- .../Model/StartImport.php | 6 +++--- app/code/Magento/ImportCsv/README.md | 3 +++ .../composer.json | 6 +++--- app/code/Magento/ImportCsv/etc/di.xml | 16 ++++++++++++++++ .../etc/module.xml | 2 +- .../registration.php | 2 +- .../Api/Data/SourceDataInterface.php | 2 +- .../Api/StartImportInterface.php | 10 ++-------- app/code/Magento/ImportCsvApi/README.md | 3 +++ .../composer.json | 4 ++-- .../etc/module.xml | 2 +- .../etc/webapi.xml | 2 +- .../registration.php | 2 +- composer.json | 4 ++-- 18 files changed, 42 insertions(+), 48 deletions(-) delete mode 100644 app/code/Magento/AsynchronousImportCsv/README.md delete mode 100644 app/code/Magento/AsynchronousImportCsv/etc/di.xml delete mode 100644 app/code/Magento/AsynchronousImportCsvApi/README.md rename app/code/Magento/{AsynchronousImportCsv => ImportCsv}/Model/SourceData.php (93%) rename app/code/Magento/{AsynchronousImportCsv => ImportCsv}/Model/StartImport.php (96%) create mode 100644 app/code/Magento/ImportCsv/README.md rename app/code/Magento/{AsynchronousImportCsv => ImportCsv}/composer.json (66%) create mode 100644 app/code/Magento/ImportCsv/etc/di.xml rename app/code/Magento/{AsynchronousImportCsv => ImportCsv}/etc/module.xml (84%) rename app/code/Magento/{AsynchronousImportCsv => ImportCsv}/registration.php (87%) rename app/code/Magento/{AsynchronousImportCsvApi => ImportCsvApi}/Api/Data/SourceDataInterface.php (93%) rename app/code/Magento/{AsynchronousImportCsvApi => ImportCsvApi}/Api/StartImportInterface.php (52%) create mode 100644 app/code/Magento/ImportCsvApi/README.md rename app/code/Magento/{AsynchronousImportCsvApi => ImportCsvApi}/composer.json (74%) rename app/code/Magento/{AsynchronousImportCsvApi => ImportCsvApi}/etc/module.xml (84%) rename app/code/Magento/{AsynchronousImportCsvApi => ImportCsvApi}/etc/webapi.xml (80%) rename app/code/Magento/{AsynchronousImportCsvApi => ImportCsvApi}/registration.php (86%) diff --git a/app/code/Magento/AsynchronousImportCsv/README.md b/app/code/Magento/AsynchronousImportCsv/README.md deleted file mode 100644 index 515e0a28d6ab3..0000000000000 --- a/app/code/Magento/AsynchronousImportCsv/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# AsynchronousImportCsv module - -The `AsynchronousImportCsv` module provides possibility to upload CSV files as source type diff --git a/app/code/Magento/AsynchronousImportCsv/etc/di.xml b/app/code/Magento/AsynchronousImportCsv/etc/di.xml deleted file mode 100644 index 2111e84e32d40..0000000000000 --- a/app/code/Magento/AsynchronousImportCsv/etc/di.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - diff --git a/app/code/Magento/AsynchronousImportCsvApi/README.md b/app/code/Magento/AsynchronousImportCsvApi/README.md deleted file mode 100644 index 0e27d20f539b3..0000000000000 --- a/app/code/Magento/AsynchronousImportCsvApi/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# AsynchronousImportCsvApi module - -The `AsynchronousImportCsvApi` module provides service contracts interfaces for upload CSV sources diff --git a/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php b/app/code/Magento/ImportCsv/Model/SourceData.php similarity index 93% rename from app/code/Magento/AsynchronousImportCsv/Model/SourceData.php rename to app/code/Magento/ImportCsv/Model/SourceData.php index 5473b9fe907a8..aac68f02d4c01 100644 --- a/app/code/Magento/AsynchronousImportCsv/Model/SourceData.php +++ b/app/code/Magento/ImportCsv/Model/SourceData.php @@ -5,9 +5,9 @@ */ declare(strict_types=1); -namespace Magento\AsynchronousImportCsv\Model; +namespace Magento\ImportCsv\Model; -use Magento\AsynchronousImportCsvApi\Api\Data\SourceDataInterface; +use Magento\ImportCsvApi\Api\Data\SourceDataInterface; class SourceData implements SourceDataInterface { diff --git a/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php similarity index 96% rename from app/code/Magento/AsynchronousImportCsv/Model/StartImport.php rename to app/code/Magento/ImportCsv/Model/StartImport.php index f9f9ae16ea606..3bc69e799fadc 100644 --- a/app/code/Magento/AsynchronousImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -5,10 +5,10 @@ */ declare(strict_types=1); -namespace Magento\AsynchronousImportCsv\Model; +namespace Magento\ImportCsv\Model; -use Magento\AsynchronousImportCsvApi\Api\Data\SourceDataInterface; -use Magento\AsynchronousImportCsvApi\Api\StartImportInterface; +use Magento\ImportCsvApi\Api\Data\SourceDataInterface; +use Magento\ImportCsvApi\Api\StartImportInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\ObjectManagerInterface; use Magento\ImportExport\Model\Import; diff --git a/app/code/Magento/ImportCsv/README.md b/app/code/Magento/ImportCsv/README.md new file mode 100644 index 0000000000000..433b5d91df345 --- /dev/null +++ b/app/code/Magento/ImportCsv/README.md @@ -0,0 +1,3 @@ +# ImportCsv module + +The `ImportCsv` module provides possibility to upload CSV files as source type diff --git a/app/code/Magento/AsynchronousImportCsv/composer.json b/app/code/Magento/ImportCsv/composer.json similarity index 66% rename from app/code/Magento/AsynchronousImportCsv/composer.json rename to app/code/Magento/ImportCsv/composer.json index f3c35ed81c6da..6dc3b54b29fd5 100644 --- a/app/code/Magento/AsynchronousImportCsv/composer.json +++ b/app/code/Magento/ImportCsv/composer.json @@ -1,10 +1,10 @@ { - "name": "magento/module-asynchronous-import-csv", + "name": "magento/module-import-csv", "description": "N/A", "require": { "php": "~7.4.0||~8.1.0", "magento/framework": "*", - "magento/module-asynchronous-import-csv-api": "*", + "magento/module-import-csv-api": "*", }, "type": "magento2-module", "license": [ @@ -16,7 +16,7 @@ "registration.php" ], "psr-4": { - "Magento\\AsynchronousImportCsv\\": "" + "Magento\\ImportCsv\\": "" } } } diff --git a/app/code/Magento/ImportCsv/etc/di.xml b/app/code/Magento/ImportCsv/etc/di.xml new file mode 100644 index 0000000000000..c71f0dd08102a --- /dev/null +++ b/app/code/Magento/ImportCsv/etc/di.xml @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/app/code/Magento/AsynchronousImportCsv/etc/module.xml b/app/code/Magento/ImportCsv/etc/module.xml similarity index 84% rename from app/code/Magento/AsynchronousImportCsv/etc/module.xml rename to app/code/Magento/ImportCsv/etc/module.xml index c3cd3d4f374f8..ba8963a0f4a34 100644 --- a/app/code/Magento/AsynchronousImportCsv/etc/module.xml +++ b/app/code/Magento/ImportCsv/etc/module.xml @@ -7,5 +7,5 @@ --> - + diff --git a/app/code/Magento/AsynchronousImportCsv/registration.php b/app/code/Magento/ImportCsv/registration.php similarity index 87% rename from app/code/Magento/AsynchronousImportCsv/registration.php rename to app/code/Magento/ImportCsv/registration.php index 955af83d92723..b39c3ff6ebea0 100644 --- a/app/code/Magento/AsynchronousImportCsv/registration.php +++ b/app/code/Magento/ImportCsv/registration.php @@ -7,4 +7,4 @@ use Magento\Framework\Component\ComponentRegistrar; -ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AsynchronousImportCsv', __DIR__); +ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_ImportCsv', __DIR__); diff --git a/app/code/Magento/AsynchronousImportCsvApi/Api/Data/SourceDataInterface.php b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php similarity index 93% rename from app/code/Magento/AsynchronousImportCsvApi/Api/Data/SourceDataInterface.php rename to app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php index 93c9a5f183cf0..9b27dc223e2b5 100644 --- a/app/code/Magento/AsynchronousImportCsvApi/Api/Data/SourceDataInterface.php +++ b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php @@ -5,7 +5,7 @@ */ declare(strict_types=1); -namespace Magento\AsynchronousImportCsvApi\Api\Data; +namespace Magento\ImportCsvApi\Api\Data; /** * Describes how to retrieve data from data source diff --git a/app/code/Magento/AsynchronousImportCsvApi/Api/StartImportInterface.php b/app/code/Magento/ImportCsvApi/Api/StartImportInterface.php similarity index 52% rename from app/code/Magento/AsynchronousImportCsvApi/Api/StartImportInterface.php rename to app/code/Magento/ImportCsvApi/Api/StartImportInterface.php index 7534acc3dafab..622450d8e6f81 100644 --- a/app/code/Magento/AsynchronousImportCsvApi/Api/StartImportInterface.php +++ b/app/code/Magento/ImportCsvApi/Api/StartImportInterface.php @@ -5,12 +5,9 @@ */ declare(strict_types=1); -namespace Magento\AsynchronousImportCsvApi\Api; +namespace Magento\ImportCsvApi\Api; -use Magento\AsynchronousImportCsvApi\Api\Data\SourceDataInterface; -use Magento\AsynchronousImportDataConvertingApi\Api\ApplyConvertingRulesException; -use Magento\AsynchronousImportDataExchangingApi\Api\ImportDataExchangeException; -use Magento\AsynchronousImportSourceDataRetrievingApi\Api\SourceDataRetrievingException; +use Magento\ImportCsvApi\Api\Data\SourceDataInterface; use Magento\Framework\Validation\ValidationException; /** @@ -26,9 +23,6 @@ interface StartImportInterface * @param SourceDataInterface $source Describes how to retrieve data from data source * @return array * @throws ValidationException - * @throws SourceDataRetrievingException - * @throws ApplyConvertingRulesException - * @throws ImportDataExchangeException */ public function execute( SourceDataInterface $source diff --git a/app/code/Magento/ImportCsvApi/README.md b/app/code/Magento/ImportCsvApi/README.md new file mode 100644 index 0000000000000..ceb3de3ea3279 --- /dev/null +++ b/app/code/Magento/ImportCsvApi/README.md @@ -0,0 +1,3 @@ +# ImportCsvApi module + +The `ImportCsvApi` module provides service contracts interfaces for upload CSV sources diff --git a/app/code/Magento/AsynchronousImportCsvApi/composer.json b/app/code/Magento/ImportCsvApi/composer.json similarity index 74% rename from app/code/Magento/AsynchronousImportCsvApi/composer.json rename to app/code/Magento/ImportCsvApi/composer.json index 0fb2c07e509e6..4aca964c4a3f9 100644 --- a/app/code/Magento/AsynchronousImportCsvApi/composer.json +++ b/app/code/Magento/ImportCsvApi/composer.json @@ -1,5 +1,5 @@ { - "name": "magento/module-asynchronous-import-csv-api", + "name": "magento/module-import-csv-api", "description": "N/A", "require": { "php": "~7.4.0||~8.1.0", @@ -15,7 +15,7 @@ "registration.php" ], "psr-4": { - "Magento\\AsynchronousImportCsvApi\\": "" + "Magento\\ImportCsvApi\\": "" } } } diff --git a/app/code/Magento/AsynchronousImportCsvApi/etc/module.xml b/app/code/Magento/ImportCsvApi/etc/module.xml similarity index 84% rename from app/code/Magento/AsynchronousImportCsvApi/etc/module.xml rename to app/code/Magento/ImportCsvApi/etc/module.xml index 334a7b14297f7..80ba5655dc53c 100644 --- a/app/code/Magento/AsynchronousImportCsvApi/etc/module.xml +++ b/app/code/Magento/ImportCsvApi/etc/module.xml @@ -7,5 +7,5 @@ --> - + diff --git a/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml b/app/code/Magento/ImportCsvApi/etc/webapi.xml similarity index 80% rename from app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml rename to app/code/Magento/ImportCsvApi/etc/webapi.xml index 5e2ec36c4ba0c..c642a30f2b292 100644 --- a/app/code/Magento/AsynchronousImportCsvApi/etc/webapi.xml +++ b/app/code/Magento/ImportCsvApi/etc/webapi.xml @@ -8,7 +8,7 @@ - + diff --git a/app/code/Magento/AsynchronousImportCsvApi/registration.php b/app/code/Magento/ImportCsvApi/registration.php similarity index 86% rename from app/code/Magento/AsynchronousImportCsvApi/registration.php rename to app/code/Magento/ImportCsvApi/registration.php index b1a2a26edb252..3585d18df4406 100644 --- a/app/code/Magento/AsynchronousImportCsvApi/registration.php +++ b/app/code/Magento/ImportCsvApi/registration.php @@ -7,4 +7,4 @@ use Magento\Framework\Component\ComponentRegistrar; -ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AsynchronousImportCsvApi', __DIR__); +ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_ImportCsvApi', __DIR__); diff --git a/composer.json b/composer.json index 3f7b9aece0246..79ae288f14470 100644 --- a/composer.json +++ b/composer.json @@ -109,8 +109,8 @@ "magento/module-amqp": "*", "magento/module-amqp-store": "*", "magento/module-analytics": "*", - "magento/module-asynchronous-import-csv": "*", - "magento/module-asynchronous-import-csv-api": "*", + "magento/module-import-csv": "*", + "magento/module-import-csv-api": "*", "magento/module-asynchronous-operations": "*", "magento/module-authorization": "*", "magento/module-advanced-search": "*", From 409f69434e67689ea5ea1b44832649ae734c9728 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 20 Jun 2022 00:02:49 -0500 Subject: [PATCH 10/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Magento/ImportCsvApi/Api/Data/SourceDataInterface.php | 1 + app/code/Magento/ImportCsvApi/Api/StartImportInterface.php | 7 +++---- app/code/Magento/ImportCsvApi/composer.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php index 9b27dc223e2b5..cdaa872a7eb68 100644 --- a/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php +++ b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php @@ -11,6 +11,7 @@ * Describes how to retrieve data from data source * * @api + * @since 100.0.2 */ interface SourceDataInterface { diff --git a/app/code/Magento/ImportCsvApi/Api/StartImportInterface.php b/app/code/Magento/ImportCsvApi/Api/StartImportInterface.php index 622450d8e6f81..de294f1ac4898 100644 --- a/app/code/Magento/ImportCsvApi/Api/StartImportInterface.php +++ b/app/code/Magento/ImportCsvApi/Api/StartImportInterface.php @@ -7,7 +7,6 @@ namespace Magento\ImportCsvApi\Api; -use Magento\ImportCsvApi\Api\Data\SourceDataInterface; use Magento\Framework\Validation\ValidationException; /** @@ -20,11 +19,11 @@ interface StartImportInterface /** * Start import operation * - * @param SourceDataInterface $source Describes how to retrieve data from data source - * @return array + * @param \Magento\ImportCsvApi\Api\Data\SourceDataInterface $source Describes how to retrieve data from data source + * @return mixed * @throws ValidationException */ public function execute( - SourceDataInterface $source + \Magento\ImportCsvApi\Api\Data\SourceDataInterface $source ): array; } diff --git a/app/code/Magento/ImportCsvApi/composer.json b/app/code/Magento/ImportCsvApi/composer.json index 4aca964c4a3f9..b38ac73cb8d69 100644 --- a/app/code/Magento/ImportCsvApi/composer.json +++ b/app/code/Magento/ImportCsvApi/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "require": { "php": "~7.4.0||~8.1.0", - "magento/framework": "*", + "magento/framework": "*" }, "type": "magento2-module", "license": [ From b5a19344d229df4327b1b8332965e76da812f4e7 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 20 Jun 2022 08:16:11 -0500 Subject: [PATCH 11/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- app/code/Magento/ImportCsv/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ImportCsv/composer.json b/app/code/Magento/ImportCsv/composer.json index 6dc3b54b29fd5..fb60b519e111e 100644 --- a/app/code/Magento/ImportCsv/composer.json +++ b/app/code/Magento/ImportCsv/composer.json @@ -4,7 +4,7 @@ "require": { "php": "~7.4.0||~8.1.0", "magento/framework": "*", - "magento/module-import-csv-api": "*", + "magento/module-import-csv-api": "*" }, "type": "magento2-module", "license": [ From 5e66811348861ccd283c2d851daf00d655056975 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 20 Jun 2022 16:11:33 -0500 Subject: [PATCH 12/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Magento/ImportCsv/Model/SourceData.php | 3 ++ .../Magento/ImportCsv/Model/StartImport.php | 1 + app/code/Magento/ImportCsv/composer.json | 3 +- app/code/Magento/ImportCsv/etc/module.xml | 6 ++- .../Magento/ImportExport/Model/Import.php | 9 +---- .../ImportExport/Model/Source/Upload.php | 12 +++++- .../Test/Unit/Helper/ReportTest.php | 6 +-- .../Test/Unit/Model/ImportTest.php | 40 ++++++------------- 8 files changed, 39 insertions(+), 41 deletions(-) diff --git a/app/code/Magento/ImportCsv/Model/SourceData.php b/app/code/Magento/ImportCsv/Model/SourceData.php index aac68f02d4c01..52dd169527dc2 100644 --- a/app/code/Magento/ImportCsv/Model/SourceData.php +++ b/app/code/Magento/ImportCsv/Model/SourceData.php @@ -82,6 +82,9 @@ public function getAllowedErrorCount(): string return $this->allowedErrorCount; } + /** + * @return array + */ public function toArray() { return [ diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index 3bc69e799fadc..041cfa2708ea5 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -89,6 +89,7 @@ public function execute( * * @return Import * @deprecated 100.1.0 + * @see Import */ private function getImport() { diff --git a/app/code/Magento/ImportCsv/composer.json b/app/code/Magento/ImportCsv/composer.json index fb60b519e111e..6d32d55f78132 100644 --- a/app/code/Magento/ImportCsv/composer.json +++ b/app/code/Magento/ImportCsv/composer.json @@ -4,7 +4,8 @@ "require": { "php": "~7.4.0||~8.1.0", "magento/framework": "*", - "magento/module-import-csv-api": "*" + "magento/module-import-csv-api": "*", + "magento/module-import-export": "*" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/ImportCsv/etc/module.xml b/app/code/Magento/ImportCsv/etc/module.xml index ba8963a0f4a34..19ca8b43492de 100644 --- a/app/code/Magento/ImportCsv/etc/module.xml +++ b/app/code/Magento/ImportCsv/etc/module.xml @@ -7,5 +7,9 @@ --> - + + + + + diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 1039ad9917729..b5ee99e99dfa2 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -179,11 +179,6 @@ class Import extends AbstractModel */ private $messageManager; - /** - * @var Random - */ - private $random; - /** * @var Upload */ @@ -236,7 +231,7 @@ public function __construct( $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; $this->upload = $upload; - $this->messageManager = $messageManager ?: ObjectManager::getInstance() + $this->messageManager = $messageManager ?: ObjectManagernstance() ->get(ManagerInterface::class); parent::__construct($logger, $filesystem, $data); } @@ -333,7 +328,7 @@ public function getOperationResultMessages(ProcessingErrorAggregatorInterface $v 'Checked rows: %1, checked entities: %2, invalid rows: %3, total errors: %4', $this->getProcessedRowsCount(), $this->getProcessedEntitiesCount(), - $validationResult->getInvalidRowsCount(), + $validationResult->genvalidRowsCount(), $validationResult->getErrorsCount( [ ProcessingError::ERROR_LEVEL_CRITICAL, diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index 9fb2d48462d33..c6190a36bf843 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -1,4 +1,10 @@ _getSourceAdapter($sourceFile); } catch (\Exception $e) { - $import->getVarDirectory()->delete($this->_varDirectory->getRelativePath($sourceFile)); + $import->getVarDirectory()->delete($import->getVarDirectory()->getRelativePath($sourceFile)); throw new LocalizedException(__($e->getMessage())); } return $source; diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index f7f576476246b..130e6b12c8880 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -27,6 +27,7 @@ use Magento\ImportExport\Model\Import; use Magento\ImportExport\Model\Import\Config; use Magento\ImportExport\Model\Import\Entity\Factory; +use Magento\ImportExport\Model\Source\Upload; use Magento\MediaStorage\Model\File\UploaderFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -196,22 +197,21 @@ public function testGetSummaryStats() ->willReturn($product); $importData = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class); $csvFactory = $this->createMock(CsvFactory::class); - $httpFactory = $this->createMock(FileTransferFactory::class); $uploaderFactory = $this->createMock(UploaderFactory::class); $behaviorFactory = $this->createMock(\Magento\ImportExport\Model\Source\Import\Behavior\Factory::class); $indexerRegistry = $this->createMock(IndexerRegistry::class); $importHistoryModel = $this->createMock(History::class); $localeDate = $this->createMock(\Magento\Framework\Stdlib\DateTime\DateTime::class); + $upload = $this->createMock(Upload::class); $import = new Import( $logger, $filesystem, - $importExportData, + $upload, $coreConfig, $importConfig, $entityFactory, $importData, $csvFactory, - $httpFactory, $uploaderFactory, $behaviorFactory, $indexerRegistry, diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php index fe3bf212ad77e..15301129d392a 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php @@ -15,12 +15,10 @@ use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Framework\Filesystem\DriverInterface; -use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerInterface; use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Phrase; use Magento\Framework\Stdlib\DateTime\DateTime; -use Magento\ImportExport\Helper\Data; use Magento\ImportExport\Model\Export\Adapter\CsvFactory; use Magento\ImportExport\Model\History; use Magento\ImportExport\Model\Import; @@ -30,6 +28,7 @@ use Magento\ImportExport\Model\Import\Entity\Factory; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; use Magento\ImportExport\Model\Import\Source\Csv; +use Magento\ImportExport\Model\Source\Upload; use Magento\ImportExport\Test\Unit\Model\Import\AbstractImportTestCase; use Magento\MediaStorage\Model\File\UploaderFactory; use PHPUnit\Framework\MockObject\MockObject; @@ -47,11 +46,6 @@ class ImportTest extends AbstractImportTestCase */ protected $_entityAdapter; - /** - * @var Data|MockObject - */ - protected $_importExportData = null; - /** * @var ConfigInterface|MockObject */ @@ -72,11 +66,6 @@ class ImportTest extends AbstractImportTestCase */ protected $_csvFactory; - /** - * @var FileTransferFactory|MockObject - */ - protected $_httpFactory; - /** * @var UploaderFactory|MockObject */ @@ -132,6 +121,11 @@ class ImportTest extends AbstractImportTestCase */ private $errorAggregatorMock; + /** + * @var Upload + */ + private $upload; + /** * Set up * @@ -147,9 +141,6 @@ protected function setUp(): void $this->_filesystem = $this->getMockBuilder(Filesystem::class) ->disableOriginalConstructor() ->getMock(); - $this->_importExportData = $this->getMockBuilder(Data::class) - ->disableOriginalConstructor() - ->getMock(); $this->_coreConfig = $this->getMockBuilder(ScopeConfigInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); @@ -190,9 +181,6 @@ protected function setUp(): void $this->_csvFactory = $this->getMockBuilder(CsvFactory::class) ->disableOriginalConstructor() ->getMock(); - $this->_httpFactory = $this->getMockBuilder(FileTransferFactory::class) - ->disableOriginalConstructor() - ->getMock(); $this->_uploaderFactory = $this->getMockBuilder(UploaderFactory::class) ->disableOriginalConstructor() ->getMock(); @@ -225,18 +213,18 @@ protected function setUp(): void ->expects($this->any()) ->method('getDriver') ->willReturn($this->_driver); + $this->upload = $this->createMock(Upload::class); $this->import = $this->getMockBuilder(Import::class) ->setConstructorArgs( [ $logger, $this->_filesystem, - $this->_importExportData, + $this->upload, $this->_coreConfig, $this->_importConfig, $this->_entityFactory, $this->_importData, $this->_csvFactory, - $this->_httpFactory, $this->_uploaderFactory, $this->_behaviorFactory, $this->indexerRegistry, @@ -544,13 +532,12 @@ public function testInvalidateIndex() $import = new Import( $logger, $this->_filesystem, - $this->_importExportData, + $this->upload, $this->_coreConfig, $this->_importConfig, $this->_entityFactory, $this->_importData, $this->_csvFactory, - $this->_httpFactory, $this->_uploaderFactory, $this->_behaviorFactory, $this->indexerRegistry, @@ -577,13 +564,12 @@ public function testInvalidateIndexWithoutIndexers() $import = new Import( $logger, $this->_filesystem, - $this->_importExportData, + $this->upload, $this->_coreConfig, $this->_importConfig, $this->_entityFactory, $this->_importData, $this->_csvFactory, - $this->_httpFactory, $this->_uploaderFactory, $this->_behaviorFactory, $this->indexerRegistry, @@ -607,13 +593,12 @@ public function testGetKnownEntity() $import = new Import( $logger, $this->_filesystem, - $this->_importExportData, + $this->upload, $this->_coreConfig, $this->_importConfig, $this->_entityFactory, $this->_importData, $this->_csvFactory, - $this->_httpFactory, $this->_uploaderFactory, $this->_behaviorFactory, $this->indexerRegistry, @@ -643,13 +628,12 @@ public function testGetUnknownEntity($entity) $import = new Import( $logger, $this->_filesystem, - $this->_importExportData, + $this->upload, $this->_coreConfig, $this->_importConfig, $this->_entityFactory, $this->_importData, $this->_csvFactory, - $this->_httpFactory, $this->_uploaderFactory, $this->_behaviorFactory, $this->indexerRegistry, From 4fa88c31557446530812931c415063f94c7645f5 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 20 Jun 2022 18:08:46 -0500 Subject: [PATCH 13/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- app/code/Magento/ImportExport/Model/Import.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index b5ee99e99dfa2..a357420096e32 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -231,7 +231,7 @@ public function __construct( $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; $this->upload = $upload; - $this->messageManager = $messageManager ?: ObjectManagernstance() + $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); parent::__construct($logger, $filesystem, $data); } @@ -328,7 +328,7 @@ public function getOperationResultMessages(ProcessingErrorAggregatorInterface $v 'Checked rows: %1, checked entities: %2, invalid rows: %3, total errors: %4', $this->getProcessedRowsCount(), $this->getProcessedEntitiesCount(), - $validationResult->genvalidRowsCount(), + $validationResult->getInvalidRowsCount(), $validationResult->getErrorsCount( [ ProcessingError::ERROR_LEVEL_CRITICAL, From 3164df823b6a21b7d1dd6afffa9fe5bf12ef5883 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 20 Jun 2022 19:31:09 -0500 Subject: [PATCH 14/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Magento/ImportCsv/Model/SourceData.php | 56 ++++++++++--------- .../Magento/ImportCsv/Model/StartImport.php | 55 +++++------------- .../Api/Data/SourceDataInterface.php | 33 ++++++++++- 3 files changed, 73 insertions(+), 71 deletions(-) diff --git a/app/code/Magento/ImportCsv/Model/SourceData.php b/app/code/Magento/ImportCsv/Model/SourceData.php index 52dd169527dc2..14cd69540814a 100644 --- a/app/code/Magento/ImportCsv/Model/SourceData.php +++ b/app/code/Magento/ImportCsv/Model/SourceData.php @@ -7,9 +7,10 @@ namespace Magento\ImportCsv\Model; +use Magento\Framework\Api\AbstractSimpleObject; use Magento\ImportCsvApi\Api\Data\SourceDataInterface; -class SourceData implements SourceDataInterface +class SourceData extends AbstractSimpleObject implements SourceDataInterface { /** @@ -32,24 +33,6 @@ class SourceData implements SourceDataInterface */ private $allowedErrorCount; - /** - * @param string $entity - * @param string $behavior - * @param string $validationStrategy - * @param string $allowedErrorCount - */ - public function __construct( - string $entity, - string $behavior, - string $validationStrategy, - string $allowedErrorCount - ) { - $this->entity = $entity; - $this->behavior = $behavior; - $this->validationStrategy = $validationStrategy; - $this->allowedErrorCount = $allowedErrorCount; - } - /** * @inheritdoc */ @@ -83,15 +66,34 @@ public function getAllowedErrorCount(): string } /** - * @return array + * @inheritDoc + */ + public function setEntity($entity) + { + $this->setData(self::ENTITY, $entity); + } + + /** + * @inheritDoc + */ + public function setBehavior($behavior) + { + return $this->setData(self::BEHAVIOR, $behavior); + } + + /** + * @inheritDoc + */ + public function setValidationStrategy($validationStrategy) + { + return $this->setData(self::VALIDATION_STRATEGY, $validationStrategy); + } + + /** + * @inheritDoc */ - public function toArray() + public function setAllowedErrorCount($allowedErrorCount) { - return [ - 'entity' => $this->entity, - 'behavior' => $this->behavior, - 'validation_strategy' => $this->validationStrategy, - 'allowed_error_count' => $this->allowedErrorCount - ]; + return $this->setData(self::ALLOWED_ERROR_COUNT, $allowedErrorCount); } } diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index 041cfa2708ea5..c6c874492f88a 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -25,26 +25,12 @@ class StartImport implements StartImportInterface private $import; /** - * @var Import\ImageDirectoryBaseProvider - */ - private $imagesDirProvider; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @param ObjectManagerInterface $objectManager - * @param Import\ImageDirectoryBaseProvider|null $imageDirectoryBaseProvider + * @param Import $import */ public function __construct( - ObjectManagerInterface $objectManager, - ?Import\ImageDirectoryBaseProvider $imageDirectoryBaseProvider = null + Import $import ) { - $this->objectManager = $objectManager; - $this->imagesDirProvider = $imageDirectoryBaseProvider - ?? ObjectManager::getInstance()->get(Import\ImageDirectoryBaseProvider::class); + $this->import = $import; } /** @@ -53,8 +39,8 @@ public function __construct( public function execute( SourceDataInterface $source ): array { - $source = $source->toArray(); - $import = $this->getImport()->setData($source); + $source = $source->__toArray(); + $import = $this->import->setData($source); $errors = []; try { $source = $this->import->getUpload()->uploadFileAndGetSourceForRest($import); @@ -64,40 +50,25 @@ public function execute( } catch (\Exception $e) { $errors[] ='Sorry, but the data is invalid or the file is not uploaded.'; } - $this->getImport()->setData('images_base_directory', $this->imagesDirProvider->getDirectory()); - $errorAggregator = $this->getImport()->getErrorAggregator(); + $errorAggregator = $this->import->getErrorAggregator(); $errorAggregator->initValidationStrategy( - $this->getImport()->getData(Import::FIELD_NAME_VALIDATION_STRATEGY), - $this->GetImport()->getData(Import::FIELD_NAME_ALLOWED_ERROR_COUNT) + $this->import->getData(Import::FIELD_NAME_VALIDATION_STRATEGY), + $this->import->getData(Import::FIELD_NAME_ALLOWED_ERROR_COUNT) ); try { - $this->getImport()->importSource(); + $this->import->importSource(); } catch (\Exception $e) { $message = $this->exceptionMessageFactory->createMessage($e); $errors[] = $message; } - if ($this->getImport()->getErrorAggregator()->hasToBeTerminated()) { + if ($this->import->getErrorAggregator()->hasToBeTerminated()) { $errors[] ='Maximum error count has been reached or system error is occurred!'; } else { - $this->getImport()->invalidateIndex(); + $this->import->invalidateIndex(); } return $errors; } - /** - * Provides import model. - * - * @return Import - * @deprecated 100.1.0 - * @see Import - */ - private function getImport() - { - if (!$this->import) { - $this->import = $this->objectManager->get(Import::class); - } - return $this->import; - } /** * Process validation result and add required error or success messages to Result block * @@ -108,7 +79,7 @@ private function getImport() */ private function processValidationResult($validationResult, $errors) { - $import = $this->getImport(); + $import = $this->import; $errorAggregator = $import->getErrorAggregator(); if ($import->getProcessedRowsCount()) { @@ -138,7 +109,7 @@ private function processValidationResult($validationResult, $errors) */ private function addMessageForValidResult($errors) { - if ($this->getImport()->isImportAllowed()) { + if ($this->import->isImportAllowed()) { $errors[]=__('File is valid! To start import process press "Import" button'); } else { $errors[] =__('The file is valid, but we can\'t import it for some reason.'); diff --git a/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php index cdaa872a7eb68..4fb218c5bef72 100644 --- a/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php +++ b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php @@ -17,8 +17,8 @@ interface SourceDataInterface { public const ENTITY = 'entity'; public const BEHAVIOR = 'behavior'; - public const VALIDATION_STRATEGY = 'validationStrategy'; - public const ALLOWED_ERROR_COUNT = 'allowedErrorCount'; + public const VALIDATION_STRATEGY = 'validation_strategy'; + public const ALLOWED_ERROR_COUNT = 'allowed_error_count'; /** * @@ -44,4 +44,33 @@ public function getValidationStrategy(): string; */ public function getAllowedErrorCount(): string; + /** + * Set Entity + * + * @param string $entity + * @return $this + */ + public function setEntity($entity); + + /** + * Set Behavior + * + * @param string $behavior + * @return $this + */ + public function setBehavior($behavior); + + /** + * Set Validation Strategy + * + * @param $validationStrategy + * @return $this + */ + public function setValidationStrategy($validationStrategy); + + /** + * @param $allowedErrorCount + * @return $this + */ + public function setAllowedErrorCount($allowedErrorCount); } From 2b5df41030684989a44976a21a55b5b23c94a356 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 20 Jun 2022 21:50:19 -0500 Subject: [PATCH 15/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Magento/ImportCsv/Model/StartImport.php | 58 ++++++++++++++----- .../Test/Unit/Helper/ReportTest.php | 1 - composer.json | 2 +- 3 files changed, 46 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index c6c874492f88a..a2f0debab15db 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -9,8 +9,7 @@ use Magento\ImportCsvApi\Api\Data\SourceDataInterface; use Magento\ImportCsvApi\Api\StartImportInterface; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\ObjectManagerInterface; +use Magento\ImportExport\Block\Adminhtml\Import\Frame\Result; use Magento\ImportExport\Model\Import; /** @@ -50,6 +49,9 @@ public function execute( } catch (\Exception $e) { $errors[] ='Sorry, but the data is invalid or the file is not uploaded.'; } + if ($errors) { + return $errors; + } $errorAggregator = $this->import->getErrorAggregator(); $errorAggregator->initValidationStrategy( $this->import->getData(Import::FIELD_NAME_VALIDATION_STRATEGY), @@ -58,8 +60,7 @@ public function execute( try { $this->import->importSource(); } catch (\Exception $e) { - $message = $this->exceptionMessageFactory->createMessage($e); - $errors[] = $message; + $errors[] = $e->getMessage(); } if ($this->import->getErrorAggregator()->hasToBeTerminated()) { $errors[] ='Maximum error count has been reached or system error is occurred!'; @@ -87,18 +88,15 @@ private function processValidationResult($validationResult, $errors) $this->addMessageForValidResult($errors); } else { $errors[] = 'Data validation failed. Please fix the following errors and upload the file again.'; - if ($errorAggregator->getErrorsCount()) { - // $this->addMessageToSkipErrors($resultBlock); + $this->addMessageToSkipErrors($errors); } } - - //$this->addErrorMessages($resultBlock, $errorAggregator); } else { if ($errorAggregator->getErrorsCount()) { - //$this->collectErrors($resultBlock); + $this->collectErrors($errors); } else { - //$resultBlock->addError(__('This file is empty. Please try another one.')); + $errors[] = (__('This file is empty. Please try another one.')); } } } @@ -109,11 +107,45 @@ private function processValidationResult($validationResult, $errors) */ private function addMessageForValidResult($errors) { - if ($this->import->isImportAllowed()) { - $errors[]=__('File is valid! To start import process press "Import" button'); - } else { + if (!$this->import->isImportAllowed()) { $errors[] =__('The file is valid, but we can\'t import it for some reason.'); } return $errors; } + + /** + * Collect errors and add error messages to Result block + * + * Get all errors from Error Aggregator and add appropriated error messages + * to Result block. + * + * @param array $errors + * @return void + * @throws \Magento\Framework\Exception\LocalizedException + */ + private function collectErrors($errors) + { + $errors = $this->import->getErrorAggregator()->getAllErrors(); + foreach ($errors as $error) { + $errors[] = $error->getErrorMessage(); + } + } + + /** + * Add error message to Result block and allow 'Import' button + * + * If validation strategy is equal to 'validation-skip-errors' and validation error limit is not exceeded, + * then add error message and allow 'Import' button. + * + * @param array $errors + * @return void + * @throws \Magento\Framework\Exception\LocalizedException + */ + private function addMessageToSkipErrors($errors) + { + $import = $this->import; + if ($import->getErrorAggregator()->hasFatalExceptions()) { + $errors[] =__('Please fix errors and re-upload file'); + } + } } diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index 130e6b12c8880..08acd3752da33 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -175,7 +175,6 @@ public function testGetSummaryStats() { $logger = $this->getMockForAbstractClass(LoggerInterface::class); $filesystem = $this->createMock(Filesystem::class); - $importExportData = $this->createMock(Data::class); $coreConfig = $this->getMockForAbstractClass(ScopeConfigInterface::class); $importConfig = $this->createPartialMock(Config::class, ['getEntities']); $importConfig->expects($this->any()) diff --git a/composer.json b/composer.json index 76febc864feea..3b1c640382eb6 100644 --- a/composer.json +++ b/composer.json @@ -109,8 +109,8 @@ "magento/module-amqp": "*", "magento/module-amqp-store": "*", "magento/module-analytics": "*", - "magento/module-import-csv": "*", "magento/module-import-csv-api": "*", + "magento/module-import-csv": "*", "magento/module-asynchronous-operations": "*", "magento/module-authorization": "*", "magento/module-advanced-search": "*", From 71a277f4ae8151d009457672f49e5adf873b99d9 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 21 Jun 2022 10:39:44 -0500 Subject: [PATCH 16/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- app/code/Magento/ImportCsv/Model/SourceData.php | 2 +- app/code/Magento/ImportCsv/Model/StartImport.php | 3 ++- .../Magento/ImportCsvApi/Api/Data/SourceDataInterface.php | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ImportCsv/Model/SourceData.php b/app/code/Magento/ImportCsv/Model/SourceData.php index 14cd69540814a..ade84f03947f0 100644 --- a/app/code/Magento/ImportCsv/Model/SourceData.php +++ b/app/code/Magento/ImportCsv/Model/SourceData.php @@ -70,7 +70,7 @@ public function getAllowedErrorCount(): string */ public function setEntity($entity) { - $this->setData(self::ENTITY, $entity); + return $this->setData(self::ENTITY, $entity); } /** diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index a2f0debab15db..de5a4b3ba5d17 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -9,7 +9,6 @@ use Magento\ImportCsvApi\Api\Data\SourceDataInterface; use Magento\ImportCsvApi\Api\StartImportInterface; -use Magento\ImportExport\Block\Adminhtml\Import\Frame\Result; use Magento\ImportExport\Model\Import; /** @@ -100,7 +99,9 @@ private function processValidationResult($validationResult, $errors) } } } + /** + * * @param array $errors * @return void * @throws \Magento\Framework\Exception\LocalizedException diff --git a/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php index 4fb218c5bef72..e621536421128 100644 --- a/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php +++ b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php @@ -21,24 +21,28 @@ interface SourceDataInterface public const ALLOWED_ERROR_COUNT = 'allowed_error_count'; /** + * Get Entity * * @return string */ public function getEntity(): string; /** + * Get Behavior * * @return string */ public function getBehavior(): string; /** + * Get Validation Strategy * * @return string */ public function getValidationStrategy(): string; /** + * Get Allowed Error Count * * @return string */ @@ -69,6 +73,8 @@ public function setBehavior($behavior); public function setValidationStrategy($validationStrategy); /** + * Set Allowed Error Count + * * @param $allowedErrorCount * @return $this */ From 84e13c4f90a4cceb13ac4f5377dd738e5420f560 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 21 Jun 2022 13:05:35 -0500 Subject: [PATCH 17/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- app/code/Magento/ImportCsv/Model/StartImport.php | 5 ++--- app/code/Magento/ImportCsv/etc/module.xml | 6 +----- .../Magento/ImportCsvApi/Api/Data/SourceDataInterface.php | 4 ++-- app/code/Magento/ImportExport/Model/Import.php | 5 ++++- app/code/Magento/ImportExport/Model/Source/Upload.php | 4 ++-- composer.json | 2 +- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index de5a4b3ba5d17..3a924911daab3 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -101,7 +101,7 @@ private function processValidationResult($validationResult, $errors) } /** - * + * * @param array $errors * @return void * @throws \Magento\Framework\Exception\LocalizedException @@ -115,10 +115,9 @@ private function addMessageForValidResult($errors) } /** - * Collect errors and add error messages to Result block + * Collect errors and add error messages * * Get all errors from Error Aggregator and add appropriated error messages - * to Result block. * * @param array $errors * @return void diff --git a/app/code/Magento/ImportCsv/etc/module.xml b/app/code/Magento/ImportCsv/etc/module.xml index 19ca8b43492de..ba8963a0f4a34 100644 --- a/app/code/Magento/ImportCsv/etc/module.xml +++ b/app/code/Magento/ImportCsv/etc/module.xml @@ -7,9 +7,5 @@ --> - - - - - + diff --git a/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php index e621536421128..d773fbcfa462c 100644 --- a/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php +++ b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php @@ -67,7 +67,7 @@ public function setBehavior($behavior); /** * Set Validation Strategy * - * @param $validationStrategy + * @param string $validationStrategy * @return $this */ public function setValidationStrategy($validationStrategy); @@ -75,7 +75,7 @@ public function setValidationStrategy($validationStrategy); /** * Set Allowed Error Count * - * @param $allowedErrorCount + * @param string $allowedErrorCount * @return $this */ public function setAllowedErrorCount($allowedErrorCount); diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index a357420096e32..2796c5f8cc735 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -16,7 +16,6 @@ use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Filesystem; use Magento\Framework\Indexer\IndexerRegistry; -use Magento\Framework\Math\Random; use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\ImportExport\Model\Export\Adapter\CsvFactory; use Magento\ImportExport\Model\Import\AbstractEntity as ImportAbstractEntity; @@ -544,6 +543,8 @@ public function uploadFileAndGetSource() } /** + * Get Var Directory instance + * * @return Filesystem\Directory\WriteInterface */ public function getVarDirectory() @@ -806,6 +807,8 @@ public function getDeletedItemsCount() } /** + * Get Upload Instance + * * @return Upload */ public function getUpload() diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index c6190a36bf843..117d4eb7687d9 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -69,7 +69,7 @@ public function __construct( /** * Move uploaded file. * - * @param Import + * @param Import $import * @throws LocalizedException * @return string Source file path */ @@ -138,7 +138,7 @@ public function uploadSource(Import $import) /** * Move uploaded file and provide source instance. * - * * @param Import + * @param Import $import * @return Import\AbstractSource * @throws LocalizedException * @since 100.2.7 diff --git a/composer.json b/composer.json index 3b1c640382eb6..76febc864feea 100644 --- a/composer.json +++ b/composer.json @@ -109,8 +109,8 @@ "magento/module-amqp": "*", "magento/module-amqp-store": "*", "magento/module-analytics": "*", - "magento/module-import-csv-api": "*", "magento/module-import-csv": "*", + "magento/module-import-csv-api": "*", "magento/module-asynchronous-operations": "*", "magento/module-authorization": "*", "magento/module-advanced-search": "*", From e73822aca99e95b48990a029f2f943577f2ea361 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 21 Jun 2022 14:47:42 -0500 Subject: [PATCH 18/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- app/code/Magento/ImportCsv/Model/StartImport.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index 3a924911daab3..6fcce165b926e 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -101,17 +101,17 @@ private function processValidationResult($validationResult, $errors) } /** - * - * @param array $errors - * @return void - * @throws \Magento\Framework\Exception\LocalizedException - */ + * Add Message for Valid Result + * + * @param array $errors + * @return void + * @throws \Magento\Framework\Exception\LocalizedException + */ private function addMessageForValidResult($errors) { if (!$this->import->isImportAllowed()) { $errors[] =__('The file is valid, but we can\'t import it for some reason.'); } - return $errors; } /** From 7410ad90c35a7d9a2836ab34f6c8f16da52224d2 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 22 Jun 2022 09:49:23 -0500 Subject: [PATCH 19/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 76febc864feea..48733c2cebe8b 100644 --- a/composer.json +++ b/composer.json @@ -109,8 +109,6 @@ "magento/module-amqp": "*", "magento/module-amqp-store": "*", "magento/module-analytics": "*", - "magento/module-import-csv": "*", - "magento/module-import-csv-api": "*", "magento/module-asynchronous-operations": "*", "magento/module-authorization": "*", "magento/module-advanced-search": "*", @@ -191,6 +189,8 @@ "magento/module-grouped-catalog-inventory": "*", "magento/module-grouped-product-graph-ql": "*", "magento/module-import-export": "*", + "magento/module-import-csv": "*", + "magento/module-import-csv-api": "*", "magento/module-indexer": "*", "magento/module-instant-purchase": "*", "magento/module-integration": "*", From 5aa1842d96de582787511e96c47c17ae92d6d36d Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 23 Jun 2022 13:16:17 -0500 Subject: [PATCH 20/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Magento/ImportCsv/Model/StartImport.php | 4 ++ .../Magento/ImportExport/Model/Import.php | 50 +++++++++++++++++-- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index 6fcce165b926e..a2835c6d163fb 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -51,6 +51,7 @@ public function execute( if ($errors) { return $errors; } + $processedEntities = $this->import->getProcessedEntitiesCount(); $errorAggregator = $this->import->getErrorAggregator(); $errorAggregator->initValidationStrategy( $this->import->getData(Import::FIELD_NAME_VALIDATION_STRATEGY), @@ -66,6 +67,9 @@ public function execute( } else { $this->import->invalidateIndex(); } + if (!$errors) { + return ["Entities Updated: " . $processedEntities]; + } return $errors; } diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 2796c5f8cc735..42afc19df97ca 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -15,8 +15,11 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Filesystem; +use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerRegistry; +use Magento\Framework\Math\Random; use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\ImportExport\Helper\Data as DataHelper; use Magento\ImportExport\Model\Export\Adapter\CsvFactory; use Magento\ImportExport\Model\Import\AbstractEntity as ImportAbstractEntity; use Magento\ImportExport\Model\Import\AbstractSource; @@ -118,6 +121,11 @@ class Import extends AbstractModel */ protected $_entityAdapter; + /** + * @var DataHelper + */ + protected $_importExportData = null; + /** * @var \Magento\Framework\App\Config\ScopeConfigInterface */ @@ -143,6 +151,11 @@ class Import extends AbstractModel */ protected $_csvFactory; + /** + * @var FileTransferFactory + */ + protected $_httpFactory; + /** * @var UploaderFactory */ @@ -178,6 +191,11 @@ class Import extends AbstractModel */ private $messageManager; + /** + * @var Random + */ + private $random; + /** * @var Upload */ @@ -186,12 +204,13 @@ class Import extends AbstractModel /** * @param LoggerInterface $logger * @param Filesystem $filesystem - * @param Upload $upload + * @param DataHelper $importExportData * @param ScopeConfigInterface $coreConfig * @param Import\ConfigInterface $importConfig * @param Import\Entity\Factory $entityFactory * @param Data $importData * @param Export\Adapter\CsvFactory $csvFactory + * @param FileTransferFactory $httpFactory * @param UploaderFactory $uploaderFactory * @param Source\Import\Behavior\Factory $behaviorFactory * @param IndexerRegistry $indexerRegistry @@ -199,39 +218,49 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager + * @param Random|null $random + * @param Upload|null $upload * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( LoggerInterface $logger, Filesystem $filesystem, - Upload $upload, + DataHelper $importExportData, ScopeConfigInterface $coreConfig, ConfigInterface $importConfig, Factory $entityFactory, Data $importData, CsvFactory $csvFactory, + FileTransferFactory $httpFactory, UploaderFactory $uploaderFactory, BehaviorFactory $behaviorFactory, IndexerRegistry $indexerRegistry, History $importHistoryModel, DateTime $localeDate, array $data = [], - ManagerInterface $messageManager = null + ManagerInterface $messageManager = null, + Random $random = null, + Upload $upload = null ) { + $this->_importExportData = $importExportData; $this->_coreConfig = $coreConfig; $this->_importConfig = $importConfig; $this->_entityFactory = $entityFactory; $this->_importData = $importData; $this->_csvFactory = $csvFactory; + $this->_httpFactory = $httpFactory; $this->_uploaderFactory = $uploaderFactory; $this->indexerRegistry = $indexerRegistry; $this->_behaviorFactory = $behaviorFactory; $this->_filesystem = $filesystem; $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; - $this->upload = $upload; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); + $this->random = $random ?: ObjectManager::getInstance() + ->get(Random::class); + $this->upload = $upload ?: ObjectManager::getInstance() + ->get(Upload::class); parent::__construct($logger, $filesystem, $data); } @@ -522,6 +551,17 @@ public function getErrorAggregator() return $this->_getEntityAdapter()->getErrorAggregator(); } + /** + * Move uploaded file. + * + * @throws LocalizedException + * @return string Source file path + */ + public function uploadSource() + { + return $this->upload->uploadSource($this); + } + /** * Move uploaded file and provide source instance. * @@ -531,7 +571,7 @@ public function getErrorAggregator() */ public function uploadFileAndGetSource() { - $sourceFile = $this->upload->uploadSource($this); + $sourceFile = $this->uploadSource(); try { $source = $this->_getSourceAdapter($sourceFile); } catch (\Exception $e) { From 8703060900b212d48a0038c66cf0fcee1b3a1dff Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 23 Jun 2022 13:28:35 -0500 Subject: [PATCH 21/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- app/code/Magento/ImportExport/Model/Import.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 42afc19df97ca..2771ffbf1417f 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -122,6 +122,7 @@ class Import extends AbstractModel protected $_entityAdapter; /** + * @Deprecated Property isn't used * @var DataHelper */ protected $_importExportData = null; @@ -152,6 +153,7 @@ class Import extends AbstractModel protected $_csvFactory; /** + * @Deprecated Property isn't used * @var FileTransferFactory */ protected $_httpFactory; @@ -192,6 +194,7 @@ class Import extends AbstractModel private $messageManager; /** + * @Deprecated Property isn't used * @var Random */ private $random; From 2e2a2fe82e845a57ff67be5620186ce53bceec0d Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 23 Jun 2022 16:43:03 -0500 Subject: [PATCH 22/57] MCP-1034: [Prototype] Develop Rest API Import Endpoint --- .../Magento/ImportCsv/Model/StartImport.php | 2 +- .../Test/Unit/Helper/ReportTest.php | 11 +++- .../Test/Unit/Model/ImportTest.php | 63 ++++++++++++++++--- 3 files changed, 63 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index a2835c6d163fb..f13e2afb74051 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -68,7 +68,7 @@ public function execute( $this->import->invalidateIndex(); } if (!$errors) { - return ["Entities Updated: " . $processedEntities]; + return ["Entities Processed: " . $processedEntities]; } return $errors; } diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index 08acd3752da33..2f10ce42f84d4 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -175,6 +175,7 @@ public function testGetSummaryStats() { $logger = $this->getMockForAbstractClass(LoggerInterface::class); $filesystem = $this->createMock(Filesystem::class); + $importExportData = $this->createMock(Data::class); $coreConfig = $this->getMockForAbstractClass(ScopeConfigInterface::class); $importConfig = $this->createPartialMock(Config::class, ['getEntities']); $importConfig->expects($this->any()) @@ -196,6 +197,7 @@ public function testGetSummaryStats() ->willReturn($product); $importData = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class); $csvFactory = $this->createMock(CsvFactory::class); + $httpFactory = $this->createMock(FileTransferFactory::class); $uploaderFactory = $this->createMock(UploaderFactory::class); $behaviorFactory = $this->createMock(\Magento\ImportExport\Model\Source\Import\Behavior\Factory::class); $indexerRegistry = $this->createMock(IndexerRegistry::class); @@ -205,17 +207,22 @@ public function testGetSummaryStats() $import = new Import( $logger, $filesystem, - $upload, + $importExportData, $coreConfig, $importConfig, $entityFactory, $importData, $csvFactory, + $httpFactory, $uploaderFactory, $behaviorFactory, $indexerRegistry, $importHistoryModel, - $localeDate + $localeDate, + [], + null, + null, + $upload ); $import->setData('entity', 'catalog_product'); $message = $this->report->getSummaryStats($import); diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php index 15301129d392a..3f5b40cef7982 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php @@ -15,10 +15,12 @@ use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Framework\Filesystem\DriverInterface; +use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerInterface; use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Phrase; use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\ImportExport\Helper\Data; use Magento\ImportExport\Model\Export\Adapter\CsvFactory; use Magento\ImportExport\Model\History; use Magento\ImportExport\Model\Import; @@ -46,6 +48,11 @@ class ImportTest extends AbstractImportTestCase */ protected $_entityAdapter; + /** + * @var Data|MockObject + */ + protected $_importExportData = null; + /** * @var ConfigInterface|MockObject */ @@ -66,6 +73,11 @@ class ImportTest extends AbstractImportTestCase */ protected $_csvFactory; + /** + * @var FileTransferFactory|MockObject + */ + protected $_httpFactory; + /** * @var UploaderFactory|MockObject */ @@ -141,6 +153,9 @@ protected function setUp(): void $this->_filesystem = $this->getMockBuilder(Filesystem::class) ->disableOriginalConstructor() ->getMock(); + $this->_importExportData = $this->getMockBuilder(Data::class) + ->disableOriginalConstructor() + ->getMock(); $this->_coreConfig = $this->getMockBuilder(ScopeConfigInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); @@ -181,6 +196,9 @@ protected function setUp(): void $this->_csvFactory = $this->getMockBuilder(CsvFactory::class) ->disableOriginalConstructor() ->getMock(); + $this->_httpFactory = $this->getMockBuilder(FileTransferFactory::class) + ->disableOriginalConstructor() + ->getMock(); $this->_uploaderFactory = $this->getMockBuilder(UploaderFactory::class) ->disableOriginalConstructor() ->getMock(); @@ -219,17 +237,22 @@ protected function setUp(): void [ $logger, $this->_filesystem, - $this->upload, + $this->_importExportData, $this->_coreConfig, $this->_importConfig, $this->_entityFactory, $this->_importData, $this->_csvFactory, + $this->_httpFactory, $this->_uploaderFactory, $this->_behaviorFactory, $this->indexerRegistry, $this->historyModel, - $this->dateTime + $this->dateTime, + [], + null, + null, + $this->upload ] ) ->setMethods( @@ -532,17 +555,22 @@ public function testInvalidateIndex() $import = new Import( $logger, $this->_filesystem, - $this->upload, + $this->_importExportData, $this->_coreConfig, $this->_importConfig, $this->_entityFactory, $this->_importData, $this->_csvFactory, + $this->_httpFactory, $this->_uploaderFactory, $this->_behaviorFactory, $this->indexerRegistry, $this->historyModel, - $this->dateTime + $this->dateTime, + [], + null, + null, + $this->upload ); $import->setEntity('test'); @@ -564,17 +592,22 @@ public function testInvalidateIndexWithoutIndexers() $import = new Import( $logger, $this->_filesystem, - $this->upload, + $this->_importExportData, $this->_coreConfig, $this->_importConfig, $this->_entityFactory, $this->_importData, $this->_csvFactory, + $this->_httpFactory, $this->_uploaderFactory, $this->_behaviorFactory, $this->indexerRegistry, $this->historyModel, - $this->dateTime + $this->dateTime, + [], + null, + null, + $this->upload ); $import->setEntity('test'); @@ -593,17 +626,22 @@ public function testGetKnownEntity() $import = new Import( $logger, $this->_filesystem, - $this->upload, + $this->_importExportData, $this->_coreConfig, $this->_importConfig, $this->_entityFactory, $this->_importData, $this->_csvFactory, + $this->_httpFactory, $this->_uploaderFactory, $this->_behaviorFactory, $this->indexerRegistry, $this->historyModel, - $this->dateTime + $this->dateTime, + [], + null, + null, + $this->upload ); $import->setEntity('test'); @@ -628,17 +666,22 @@ public function testGetUnknownEntity($entity) $import = new Import( $logger, $this->_filesystem, - $this->upload, + $this->_importExportData, $this->_coreConfig, $this->_importConfig, $this->_entityFactory, $this->_importData, $this->_csvFactory, + $this->_httpFactory, $this->_uploaderFactory, $this->_behaviorFactory, $this->indexerRegistry, $this->historyModel, - $this->dateTime + $this->dateTime, + [], + null, + null, + $this->upload ); $import->setEntity($entity); From bf98c38f1ab8bd5f057555c160ce5c5001323c66 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Sat, 25 Jun 2022 18:34:35 -0500 Subject: [PATCH 23/57] ACPT-491: Move current REST API Endpoint to Admin Section --- app/code/Magento/ImportCsvApi/etc/acl.xml | 20 ++++++++++++++++++++ app/code/Magento/ImportCsvApi/etc/webapi.xml | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/ImportCsvApi/etc/acl.xml diff --git a/app/code/Magento/ImportCsvApi/etc/acl.xml b/app/code/Magento/ImportCsvApi/etc/acl.xml new file mode 100644 index 0000000000000..2201993f2ebf9 --- /dev/null +++ b/app/code/Magento/ImportCsvApi/etc/acl.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + diff --git a/app/code/Magento/ImportCsvApi/etc/webapi.xml b/app/code/Magento/ImportCsvApi/etc/webapi.xml index c642a30f2b292..62225e30e1a43 100644 --- a/app/code/Magento/ImportCsvApi/etc/webapi.xml +++ b/app/code/Magento/ImportCsvApi/etc/webapi.xml @@ -10,7 +10,7 @@ - + From 8106ac4c150825ef763febee92124c083097d37f Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 28 Jun 2022 18:27:31 -0500 Subject: [PATCH 24/57] ACPT-492: Check that current REST API endpoint work without any issue with S3 Adobe Commerce configuration --- app/code/Magento/ImportExport/Model/Source/Upload.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index 117d4eb7687d9..77bf1d8366df6 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -36,10 +36,6 @@ class Upload */ protected $_uploaderFactory; - /** - * @var File - */ - private $filesystemIo; /** * @var Random */ @@ -49,7 +45,6 @@ class Upload * @param FileTransferFactory $httpFactory * @param DataHelper $importExportData * @param UploaderFactory $uploaderFactory - * @param File $filesystemIo * @param Random|null $random */ public function __construct( @@ -62,7 +57,6 @@ public function __construct( $this->_httpFactory = $httpFactory; $this->_importExportData = $importExportData; $this->_uploaderFactory = $uploaderFactory; - $this->filesystemIo = $filesystemIo; $this->random = $random ?: ObjectManager::getInstance() ->get(Random::class); } @@ -160,7 +154,7 @@ public function uploadFileAndGetSourceForRest(Import $import) $sourceFile .= '.' . $extension; $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); - $this->filesystemIo->cp($sourceFile, $uploadedFile); + $import->getVarDirectory()->copyFile($sourceFile, $uploadedFile); if (strtolower($uploadedFile) != strtolower($sourceFile)) { if ($import->getVarDirectory()->isExist($sourceFileRelative)) { From 8f37e41cf620d91694da72e908f1b3d0cc0fb9aa Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 1 Jul 2022 16:31:11 -0500 Subject: [PATCH 25/57] ACPT-493: Upload csv with API request parameter --- .../Model/Import/Product.php | 20 +++- .../Magento/ImportCsv/Model/SourceData.php | 17 +++ .../Magento/ImportCsv/Model/StartImport.php | 3 +- .../Api/Data/SourceDataInterface.php | 16 +++ .../Magento/ImportExport/Model/Import.php | 10 +- .../Model/Import/Entity/AbstractEntity.php | 108 ++++++++++++++---- .../ImportExport/Model/Source/Upload.php | 4 +- 7 files changed, 147 insertions(+), 31 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index ac18211b44bd4..ca7866d7d7537 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -23,7 +23,6 @@ use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Driver\File; -use Magento\Framework\Filesystem\DriverPool; use Magento\Framework\Intl\DateTimeFactory; use Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor; use Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface; @@ -2927,6 +2926,25 @@ protected function _saveValidatedBunches() return parent::_saveValidatedBunches(); } + /** + * @param Import $import + * @return void + */ + protected function _saveValidatedBunchesWithoutSource(Import $import) + { + $rowsData = preg_split("/\r\n|\n|\r/", base64_decode($import->getData('csvData'))); + $colNames = explode(',', $rowsData[0]); + $rowsData = array_splice($rowsData, 1); + foreach (array_values($rowsData) as $key => $rowData) { + $rowData = array_combine($colNames, str_getcsv($rowData, ',', '"')); + $rowData = $this->_customFieldsMapping($rowData); + $this->validateRow($rowData, $key); + } + $this->checkUrlKeyDuplicates(); + $this->getOptionEntity()->validateAmbiguousData(); + return parent::_saveValidatedBunchesWithoutSource($import); + } + /** * Check that url_keys are not assigned to other products in DB * diff --git a/app/code/Magento/ImportCsv/Model/SourceData.php b/app/code/Magento/ImportCsv/Model/SourceData.php index ade84f03947f0..db38e630cbcb2 100644 --- a/app/code/Magento/ImportCsv/Model/SourceData.php +++ b/app/code/Magento/ImportCsv/Model/SourceData.php @@ -96,4 +96,21 @@ public function setAllowedErrorCount($allowedErrorCount) { return $this->setData(self::ALLOWED_ERROR_COUNT, $allowedErrorCount); } + + /** + * @inheritDoc + */ + public function setCsvData($csvData) + { + return $this->setData(self::PAYLOAD, $csvData); + } + + /** + * @inheritDoc + */ + public function getCsvData() + { + return $this->csvData; + } + } diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index f13e2afb74051..0fa0d94fa88bc 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -41,8 +41,7 @@ public function execute( $import = $this->import->setData($source); $errors = []; try { - $source = $this->import->getUpload()->uploadFileAndGetSourceForRest($import); - $this->processValidationResult($import->validateSource($source), $errors); + $this->processValidationResult($import->validateSource(), $errors); } catch (\Magento\Framework\Exception\LocalizedException $e) { $errors[] = $e->getMessage(); } catch (\Exception $e) { diff --git a/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php index d773fbcfa462c..ecebb5c76153a 100644 --- a/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php +++ b/app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php @@ -19,6 +19,7 @@ interface SourceDataInterface public const BEHAVIOR = 'behavior'; public const VALIDATION_STRATEGY = 'validation_strategy'; public const ALLOWED_ERROR_COUNT = 'allowed_error_count'; + public const PAYLOAD = 'csvData'; /** * Get Entity @@ -79,4 +80,19 @@ public function setValidationStrategy($validationStrategy); * @return $this */ public function setAllowedErrorCount($allowedErrorCount); + + /** + * Set Allowed Error Count + * + * @param string $csvData + * @return $this + */ + public function setCsvData($csvData); + + /** + * Set Allowed Error Count + * + * @return string + */ + public function getCsvData(); } diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 2771ffbf1417f..644e8f39fc5a3 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -18,6 +18,7 @@ use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerRegistry; use Magento\Framework\Math\Random; +use Magento\Framework\Message\ManagerInterface; use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\ImportExport\Helper\Data as DataHelper; use Magento\ImportExport\Model\Export\Adapter\CsvFactory; @@ -29,7 +30,6 @@ use Magento\ImportExport\Model\Import\Entity\Factory; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; -use Magento\Framework\Message\ManagerInterface; use Magento\ImportExport\Model\ResourceModel\Import\Data; use Magento\ImportExport\Model\Source\Import\AbstractBehavior; use Magento\ImportExport\Model\Source\Import\Behavior\Factory as BehaviorFactory; @@ -619,11 +619,11 @@ public function _removeBom($sourceFile) * Before validate data the method requires to initialize error aggregator (ProcessingErrorAggregatorInterface) * with 'validation strategy' and 'allowed error count' values to allow using this parameters in validation process. * - * @param AbstractSource $source + * @param AbstractSource|null $source * @return bool * @throws LocalizedException */ - public function validateSource(AbstractSource $source) + public function validateSource(AbstractSource $source = null) { $this->addLogComment(__('Begin data validation')); @@ -634,8 +634,8 @@ public function validateSource(AbstractSource $source) ); try { - $adapter = $this->_getEntityAdapter()->setSource($source); - $adapter->validateData(); + $adapter = $source ? $this->_getEntityAdapter()->setSource($source) : $this->_getEntityAdapter(); + $adapter->validateData($this); } catch (\Exception $e) { $errorAggregator->addError( AbstractEntity::ERROR_CODE_SYSTEM_EXCEPTION, diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php index 9188f38390a2a..24558bc729e63 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php @@ -9,6 +9,7 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Serialize\Serializer\Json; +use Magento\ImportExport\Model\Import; use Magento\ImportExport\Model\Import\AbstractSource; use Magento\ImportExport\Model\Import as ImportExport; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError; @@ -382,8 +383,6 @@ protected function _saveValidatedBunches() $bunchRows = []; $startNewBunch = false; $nextRowBackup = []; - $maxDataSize = $this->_resourceHelper->getMaxDataSize(); - $bunchSize = $this->_importExportData->getBunchSize(); $skuSet = []; $source->rewind(); @@ -411,26 +410,85 @@ protected function _saveValidatedBunches() continue; } - $this->_processedRowsCount++; + $this->saveBunch($source->key(), $startNewBunch, $nextRowBackup, $currentDataSize, $bunchRows, $rowData); + $source->next(); + } + } + $this->_processedEntitiesCount = (count($skuSet)) ?: $this->_processedRowsCount; - if ($this->validateRow($rowData, $source->key())) { - // add row to bunch for save - $rowData = $this->_prepareRowForDb($rowData); - $rowSize = strlen($this->jsonHelper->jsonEncode($rowData) ?? ''); + return $this; + } + + private function saveBunch($key, &$startNewBunch, &$nextRowBackup, &$currentDataSize, &$bunchRows, $rowData) + { + $this->_processedRowsCount++; + $maxDataSize = $this->_resourceHelper->getMaxDataSize(); + $bunchSize = $this->_importExportData->getBunchSize(); + if ($this->validateRow($rowData, $key)) { + // add row to bunch for save + $rowData = $this->_prepareRowForDb($rowData); + $rowSize = strlen($this->jsonHelper->jsonEncode($rowData) ?? ''); + + $isBunchSizeExceeded = $bunchSize > 0 && count($bunchRows) >= $bunchSize; + + if ($currentDataSize + $rowSize >= $maxDataSize || $isBunchSizeExceeded) { + $startNewBunch = true; + $nextRowBackup = [$key => $rowData]; + } else { + $bunchRows[$key] = $rowData; + $currentDataSize += $rowSize; + } + } + } - $isBunchSizeExceeded = $bunchSize > 0 && count($bunchRows) >= $bunchSize; + /** + * Save DataSourceModel + * + * @param ImportExport $import + * @return void + */ + protected function _saveValidatedBunchesWithoutSource(Import $import) + { + $currentDataSize = 0; + $bunchRows = []; + $startNewBunch = false; + $nextRowBackup = []; + $skuSet = []; + $this->_dataSourceModel->cleanBunches(); + $rowsData = preg_split("/\r\n|\n|\r/", base64_decode($import->getData('csvData'))); + $colNames = explode(',', $rowsData[0]); + $rowsData = array_splice($rowsData, 1); + $flag = false; + $count = count($rowsData); + foreach (array_values($rowsData) as $key => $rowData) { + $rowData = array_combine($colNames, str_getcsv($rowData, ',', '"')); + if (($startNewBunch && $bunchRows) || $flag) { + $this->_dataSourceModel->saveBunch($this->getEntityTypeCode(), $this->getBehavior(), $bunchRows); - if ($currentDataSize + $rowSize >= $maxDataSize || $isBunchSizeExceeded) { - $startNewBunch = true; - $nextRowBackup = [$source->key() => $rowData]; - } else { - $bunchRows[$source->key()] = $rowData; - $currentDataSize += $rowSize; + $bunchRows = $nextRowBackup; + $currentDataSize = strlen($this->getSerializer()->serialize($bunchRows)); + $startNewBunch = false; + $nextRowBackup = []; + } else { + try { + if (array_key_exists('sku', $rowData)) { + $skuSet[$rowData['sku']] = true; } + } catch (\InvalidArgumentException $e) { + $this->addRowError($e->getMessage(), $this->_processedRowsCount); + $this->_processedRowsCount++; + continue; + } + + $this->saveBunch($key, $startNewBunch, $nextRowBackup, $currentDataSize, $bunchRows, $rowData); + if ($count===$key+1) { + $flag = true; } - $source->next(); } } + if ($flag) { + $this->_dataSourceModel->saveBunch($this->getEntityTypeCode(), $this->getBehavior(), $bunchRows); + } $this->_processedEntitiesCount = (count($skuSet)) ?: $this->_processedRowsCount; return $this; @@ -782,25 +840,31 @@ public function setSource(AbstractSource $source) /** * Validate data. * + * @param Import $import * @return ProcessingErrorAggregatorInterface * @throws \Magento\Framework\Exception\LocalizedException * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - public function validateData() + public function validateData(Import $import) { if (!$this->_dataValidated) { $this->getErrorAggregator()->clear(); // do all permanent columns exist? - $absentColumns = array_diff($this->_permanentAttributes, $this->getSource()->getColNames()); + if ($this->_source) { + $colNames = $this->getSource()->getColNames(); + } else { + $colNames = explode(',', preg_split("/\r\n|\n|\r/", base64_decode($import->getData('csvData')))[0]); + } + $absentColumns = array_diff($this->_permanentAttributes, $colNames); $this->addErrors(self::ERROR_CODE_COLUMN_NOT_FOUND, $absentColumns); - if (ImportExport::BEHAVIOR_DELETE != $this->getBehavior()) { + if (Import::BEHAVIOR_DELETE != $this->getBehavior()) { // check attribute columns names validity $columnNumber = 0; $emptyHeaderColumns = []; $invalidColumns = []; $invalidAttributes = []; - foreach ($this->getSource()->getColNames() as $columnName) { + foreach ($colNames as $columnName) { $columnNumber++; if (!$this->isAttributeParticular($columnName)) { if (trim($columnName ?? '') == '') { @@ -818,7 +882,11 @@ public function validateData() } if (!$this->getErrorAggregator()->getErrorsCount()) { - $this->_saveValidatedBunches(); + if ($this->_source) { + $this->_saveValidatedBunches(); + } else { + $this->_saveValidatedBunchesWithoutSource($import); + } $this->_dataValidated = true; } } diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index 77bf1d8366df6..78b3b3c8eba33 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -5,7 +5,6 @@ */ declare(strict_types=1); - namespace Magento\ImportExport\Model\Source; use Magento\Framework\App\ObjectManager; @@ -51,7 +50,6 @@ public function __construct( FileTransferFactory $httpFactory, DataHelper $importExportData, UploaderFactory $uploaderFactory, - File $filesystemIo, Random $random ) { $this->_httpFactory = $httpFactory; @@ -154,7 +152,7 @@ public function uploadFileAndGetSourceForRest(Import $import) $sourceFile .= '.' . $extension; $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); - $import->getVarDirectory()->copyFile($sourceFile, $uploadedFile); + $import->getVarDirectory()->writeFile($uploadedFile, base64_decode($import->getData('csvData'))); if (strtolower($uploadedFile) != strtolower($sourceFile)) { if ($import->getVarDirectory()->isExist($sourceFileRelative)) { From 2a019ace61280eb4db46a32e66a2ce4122637aa9 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Thu, 14 Jul 2022 02:28:52 -0500 Subject: [PATCH 26/57] ACPT-493: Upload csv with API request parameter --- .../Model/Import/Product.php | 19 --- .../Magento/ImportCsv/Model/StartImport.php | 3 +- .../Magento/ImportExport/Model/Import.php | 23 +++- .../ImportExport/Model/Import/Adapter.php | 12 ++ .../Model/Import/Entity/AbstractEntity.php | 108 ++++-------------- .../ImportExport/Model/Import/Source/Data.php | 47 ++++++++ .../ImportExport/Model/Source/Upload.php | 35 +----- 7 files changed, 101 insertions(+), 146 deletions(-) create mode 100644 app/code/Magento/ImportExport/Model/Import/Source/Data.php diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index ca7866d7d7537..f2d255ef2c57d 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -2926,25 +2926,6 @@ protected function _saveValidatedBunches() return parent::_saveValidatedBunches(); } - /** - * @param Import $import - * @return void - */ - protected function _saveValidatedBunchesWithoutSource(Import $import) - { - $rowsData = preg_split("/\r\n|\n|\r/", base64_decode($import->getData('csvData'))); - $colNames = explode(',', $rowsData[0]); - $rowsData = array_splice($rowsData, 1); - foreach (array_values($rowsData) as $key => $rowData) { - $rowData = array_combine($colNames, str_getcsv($rowData, ',', '"')); - $rowData = $this->_customFieldsMapping($rowData); - $this->validateRow($rowData, $key); - } - $this->checkUrlKeyDuplicates(); - $this->getOptionEntity()->validateAmbiguousData(); - return parent::_saveValidatedBunchesWithoutSource($import); - } - /** * Check that url_keys are not assigned to other products in DB * diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index 0fa0d94fa88bc..f13e2afb74051 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -41,7 +41,8 @@ public function execute( $import = $this->import->setData($source); $errors = []; try { - $this->processValidationResult($import->validateSource(), $errors); + $source = $this->import->getUpload()->uploadFileAndGetSourceForRest($import); + $this->processValidationResult($import->validateSource($source), $errors); } catch (\Magento\Framework\Exception\LocalizedException $e) { $errors[] = $e->getMessage(); } catch (\Exception $e) { diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 644e8f39fc5a3..4dc5eb19a69ab 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -328,6 +328,21 @@ public function _getSourceAdapter($sourceFile) ); } + /** + * Returns source adapter object. + * + * @param string $sourceFile Full path to source file + * @return AbstractSource + * @throws FileSystemException + */ + public function _getSourceAdapterForApi($sourceData) + { + return Adapter::findAdapterForData( + $sourceData, + $this->getData(self::FIELD_FIELD_SEPARATOR) + ); + } + /** * Return operation result messages * @@ -619,11 +634,11 @@ public function _removeBom($sourceFile) * Before validate data the method requires to initialize error aggregator (ProcessingErrorAggregatorInterface) * with 'validation strategy' and 'allowed error count' values to allow using this parameters in validation process. * - * @param AbstractSource|null $source + * @param AbstractSource $source * @return bool * @throws LocalizedException */ - public function validateSource(AbstractSource $source = null) + public function validateSource(AbstractSource $source) { $this->addLogComment(__('Begin data validation')); @@ -634,8 +649,8 @@ public function validateSource(AbstractSource $source = null) ); try { - $adapter = $source ? $this->_getEntityAdapter()->setSource($source) : $this->_getEntityAdapter(); - $adapter->validateData($this); + $adapter = $this->_getEntityAdapter()->setSource($source); + $adapter->validateData(); } catch (\Exception $e) { $errorAggregator->addError( AbstractEntity::ERROR_CODE_SYSTEM_EXCEPTION, diff --git a/app/code/Magento/ImportExport/Model/Import/Adapter.php b/app/code/Magento/ImportExport/Model/Import/Adapter.php index 0242ae6096316..af05df2222c1f 100644 --- a/app/code/Magento/ImportExport/Model/Import/Adapter.php +++ b/app/code/Magento/ImportExport/Model/Import/Adapter.php @@ -63,4 +63,16 @@ public static function findAdapterFor($source, $directory, $options = null) { return self::factory(pathinfo($source, PATHINFO_EXTENSION), $directory, $source, $options); } + + /** + * Create adapter instance for specified source. + * + * @param string $source Source + * @param mixed $options OPTIONAL Adapter constructor options + * @return AbstractSource + */ + public static function findAdapterForData($source, $options = null) + { + return self::factory('Data', null, $source, $options); + } } diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php index 24558bc729e63..9188f38390a2a 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php @@ -9,7 +9,6 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Serialize\Serializer\Json; -use Magento\ImportExport\Model\Import; use Magento\ImportExport\Model\Import\AbstractSource; use Magento\ImportExport\Model\Import as ImportExport; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError; @@ -383,6 +382,8 @@ protected function _saveValidatedBunches() $bunchRows = []; $startNewBunch = false; $nextRowBackup = []; + $maxDataSize = $this->_resourceHelper->getMaxDataSize(); + $bunchSize = $this->_importExportData->getBunchSize(); $skuSet = []; $source->rewind(); @@ -410,85 +411,26 @@ protected function _saveValidatedBunches() continue; } - $this->saveBunch($source->key(), $startNewBunch, $nextRowBackup, $currentDataSize, $bunchRows, $rowData); - $source->next(); - } - } - $this->_processedEntitiesCount = (count($skuSet)) ?: $this->_processedRowsCount; + $this->_processedRowsCount++; - return $this; - } - - private function saveBunch($key, &$startNewBunch, &$nextRowBackup, &$currentDataSize, &$bunchRows, $rowData) - { - $this->_processedRowsCount++; - $maxDataSize = $this->_resourceHelper->getMaxDataSize(); - $bunchSize = $this->_importExportData->getBunchSize(); - if ($this->validateRow($rowData, $key)) { - // add row to bunch for save - $rowData = $this->_prepareRowForDb($rowData); - $rowSize = strlen($this->jsonHelper->jsonEncode($rowData) ?? ''); - - $isBunchSizeExceeded = $bunchSize > 0 && count($bunchRows) >= $bunchSize; - - if ($currentDataSize + $rowSize >= $maxDataSize || $isBunchSizeExceeded) { - $startNewBunch = true; - $nextRowBackup = [$key => $rowData]; - } else { - $bunchRows[$key] = $rowData; - $currentDataSize += $rowSize; - } - } - } + if ($this->validateRow($rowData, $source->key())) { + // add row to bunch for save + $rowData = $this->_prepareRowForDb($rowData); + $rowSize = strlen($this->jsonHelper->jsonEncode($rowData) ?? ''); - /** - * Save DataSourceModel - * - * @param ImportExport $import - * @return void - */ - protected function _saveValidatedBunchesWithoutSource(Import $import) - { - $currentDataSize = 0; - $bunchRows = []; - $startNewBunch = false; - $nextRowBackup = []; - $skuSet = []; - $this->_dataSourceModel->cleanBunches(); - $rowsData = preg_split("/\r\n|\n|\r/", base64_decode($import->getData('csvData'))); - $colNames = explode(',', $rowsData[0]); - $rowsData = array_splice($rowsData, 1); - $flag = false; - $count = count($rowsData); - foreach (array_values($rowsData) as $key => $rowData) { - $rowData = array_combine($colNames, str_getcsv($rowData, ',', '"')); - if (($startNewBunch && $bunchRows) || $flag) { - $this->_dataSourceModel->saveBunch($this->getEntityTypeCode(), $this->getBehavior(), $bunchRows); + $isBunchSizeExceeded = $bunchSize > 0 && count($bunchRows) >= $bunchSize; - $bunchRows = $nextRowBackup; - $currentDataSize = strlen($this->getSerializer()->serialize($bunchRows)); - $startNewBunch = false; - $nextRowBackup = []; - } else { - try { - if (array_key_exists('sku', $rowData)) { - $skuSet[$rowData['sku']] = true; + if ($currentDataSize + $rowSize >= $maxDataSize || $isBunchSizeExceeded) { + $startNewBunch = true; + $nextRowBackup = [$source->key() => $rowData]; + } else { + $bunchRows[$source->key()] = $rowData; + $currentDataSize += $rowSize; } - } catch (\InvalidArgumentException $e) { - $this->addRowError($e->getMessage(), $this->_processedRowsCount); - $this->_processedRowsCount++; - continue; - } - - $this->saveBunch($key, $startNewBunch, $nextRowBackup, $currentDataSize, $bunchRows, $rowData); - if ($count===$key+1) { - $flag = true; } + $source->next(); } } - if ($flag) { - $this->_dataSourceModel->saveBunch($this->getEntityTypeCode(), $this->getBehavior(), $bunchRows); - } $this->_processedEntitiesCount = (count($skuSet)) ?: $this->_processedRowsCount; return $this; @@ -840,31 +782,25 @@ public function setSource(AbstractSource $source) /** * Validate data. * - * @param Import $import * @return ProcessingErrorAggregatorInterface * @throws \Magento\Framework\Exception\LocalizedException * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - public function validateData(Import $import) + public function validateData() { if (!$this->_dataValidated) { $this->getErrorAggregator()->clear(); // do all permanent columns exist? - if ($this->_source) { - $colNames = $this->getSource()->getColNames(); - } else { - $colNames = explode(',', preg_split("/\r\n|\n|\r/", base64_decode($import->getData('csvData')))[0]); - } - $absentColumns = array_diff($this->_permanentAttributes, $colNames); + $absentColumns = array_diff($this->_permanentAttributes, $this->getSource()->getColNames()); $this->addErrors(self::ERROR_CODE_COLUMN_NOT_FOUND, $absentColumns); - if (Import::BEHAVIOR_DELETE != $this->getBehavior()) { + if (ImportExport::BEHAVIOR_DELETE != $this->getBehavior()) { // check attribute columns names validity $columnNumber = 0; $emptyHeaderColumns = []; $invalidColumns = []; $invalidAttributes = []; - foreach ($colNames as $columnName) { + foreach ($this->getSource()->getColNames() as $columnName) { $columnNumber++; if (!$this->isAttributeParticular($columnName)) { if (trim($columnName ?? '') == '') { @@ -882,11 +818,7 @@ public function validateData(Import $import) } if (!$this->getErrorAggregator()->getErrorsCount()) { - if ($this->_source) { - $this->_saveValidatedBunches(); - } else { - $this->_saveValidatedBunchesWithoutSource($import); - } + $this->_saveValidatedBunches(); $this->_dataValidated = true; } } diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Data.php b/app/code/Magento/ImportExport/Model/Import/Source/Data.php new file mode 100644 index 0000000000000..1b3167eb306a0 --- /dev/null +++ b/app/code/Magento/ImportExport/Model/Import/Source/Data.php @@ -0,0 +1,47 @@ +rows = array_splice($rowsData, 1); + parent::__construct($colNames); + } + + protected function _getNextRow() + { + if ($this->_key===count($this->rows)) { + return []; + } + $parsed =str_getcsv($this->rows[$this->_key], ',', '"'); + if (is_array($parsed) && count($parsed) != $this->_colQty) { + foreach ($parsed as $element) { + if ($element && strpos($element, "'") !== false) { + $this->_foundWrongQuoteFlag = true; + break; + } + } + } else { + $this->_foundWrongQuoteFlag = false; + } + return is_array($parsed) ? $parsed : []; + } +} diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index 78b3b3c8eba33..2dd0d676dec17 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -137,41 +137,8 @@ public function uploadSource(Import $import) */ public function uploadFileAndGetSourceForRest(Import $import) { - $entity = $import->getEntity(); - /** @var $uploader Uploader */ - $fileName = $this->random->getRandomString(32) . '.' . 'csv'; - $uploadedFile = ''; - $extension = 'csv'; - $uploadedFile = $import->getWorkingDir() . $fileName; - - if (!$extension) { - $import->getVarDirectory()->delete($uploadedFile); - throw new LocalizedException(__('The file you uploaded has no extension.')); - } - $sourceFile = $import->getWorkingDir() . $entity; - - $sourceFile .= '.' . $extension; - $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); - $import->getVarDirectory()->writeFile($uploadedFile, base64_decode($import->getData('csvData'))); - - if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($import->getVarDirectory()->isExist($sourceFileRelative)) { - $import->getVarDirectory()->delete($sourceFileRelative); - } - - try { - $import->getVarDirectory()->renameFile( - $import->getVarDirectory()->getRelativePath($uploadedFile), - $sourceFileRelative - ); - } catch (FileSystemException $e) { - throw new LocalizedException(__('The source file moving process failed.')); - } - } - $import->_removeBom($sourceFile); - $import->createHistoryReport($sourceFileRelative, $entity, $extension, ['name'=> $entity . 'csv']); try { - $source = $import->_getSourceAdapter($sourceFile); + $source = $import->_getSourceAdapterForApi(base64_decode($import->getData('csvData'))); } catch (\Exception $e) { $import->getVarDirectory()->delete($import->getVarDirectory()->getRelativePath($sourceFile)); throw new LocalizedException(__($e->getMessage())); From c6014ff49dc7e20f70f041d6f6332fd210781605 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 15 Jul 2022 12:22:52 -0500 Subject: [PATCH 27/57] ACPT-493: Upload csv with API request parameter --- .../Model/Import/Product.php | 2 +- .../Magento/ImportCsv/Model/StartImport.php | 2 +- .../Magento/ImportExport/Model/Import.php | 18 ++++++++++++------ .../ImportExport/Model/Import/Adapter.php | 7 ++++--- .../ImportExport/Model/Import/Source/Data.php | 5 +++++ .../ImportExport/Model/Source/Upload.php | 19 ------------------- 6 files changed, 23 insertions(+), 30 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index f2d255ef2c57d..405ebbc3dc7fc 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -226,7 +226,7 @@ class Product extends AbstractEntity * Links attribute name-to-link type ID. * * @deprecated 101.1.0 use DI for LinkProcessor class if you want to add additional types - * + * @see LinkProcessor * @var array */ protected $_linkNameToId = [ diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index f13e2afb74051..8811bac37bd7b 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -41,7 +41,7 @@ public function execute( $import = $this->import->setData($source); $errors = []; try { - $source = $this->import->getUpload()->uploadFileAndGetSourceForRest($import); + $source = $import->getSourceForApiData(); $this->processValidationResult($import->validateSource($source), $errors); } catch (\Magento\Framework\Exception\LocalizedException $e) { $errors[] = $e->getMessage(); diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 4dc5eb19a69ab..e6e690c5751cd 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -319,7 +319,7 @@ protected function _getEntityAdapter() * @return AbstractSource * @throws FileSystemException */ - public function _getSourceAdapter($sourceFile) + protected function _getSourceAdapter($sourceFile) { return Adapter::findAdapterFor( $sourceFile, @@ -329,16 +329,14 @@ public function _getSourceAdapter($sourceFile) } /** - * Returns source adapter object. + * Returns source adapter object for Api Data. * - * @param string $sourceFile Full path to source file * @return AbstractSource - * @throws FileSystemException */ - public function _getSourceAdapterForApi($sourceData) + protected function _getSourceAdapterForApi() { return Adapter::findAdapterForData( - $sourceData, + base64_decode($this->getData('csvData')), $this->getData(self::FIELD_FIELD_SEPARATOR) ); } @@ -600,6 +598,14 @@ public function uploadFileAndGetSource() return $source; } + /** + * @return AbstractSource + */ + public function getSourceForApiData() + { + return $this->_getSourceAdapterForApi(); + } + /** * Get Var Directory instance * diff --git a/app/code/Magento/ImportExport/Model/Import/Adapter.php b/app/code/Magento/ImportExport/Model/Import/Adapter.php index af05df2222c1f..3aa5abbc21216 100644 --- a/app/code/Magento/ImportExport/Model/Import/Adapter.php +++ b/app/code/Magento/ImportExport/Model/Import/Adapter.php @@ -23,7 +23,7 @@ class Adapter * @param mixed $options OPTIONAL Adapter constructor options * * @return AbstractSource - * + * phpcs:disable Magento2.Functions.StaticFunction * @throws \Magento\Framework\Exception\LocalizedException */ public static function factory($type, $directory, $source, $options = null) @@ -56,12 +56,12 @@ public static function factory($type, $directory, $source, $options = null) * @param string $source Source file path. * @param Write $directory * @param mixed $options OPTIONAL Adapter constructor options - * + * phpcs:disable Magento2.Functions.StaticFunction * @return AbstractSource */ public static function findAdapterFor($source, $directory, $options = null) { - return self::factory(pathinfo($source, PATHINFO_EXTENSION), $directory, $source, $options); + return self::factory(pathinfo($source, PATHINFO_EXTENSION), $directory, $source, $options); // phpcs:ignore } /** @@ -69,6 +69,7 @@ public static function findAdapterFor($source, $directory, $options = null) * * @param string $source Source * @param mixed $options OPTIONAL Adapter constructor options + * phpcs:disable Magento2.Functions.StaticFunction * @return AbstractSource */ public static function findAdapterForData($source, $options = null) diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Data.php b/app/code/Magento/ImportExport/Model/Import/Source/Data.php index 1b3167eb306a0..2dfef601fcab7 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Data.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Data.php @@ -1,4 +1,9 @@ createHistoryReport($sourceFileRelative, $entity, $extension, $result); return $sourceFile; } - - /** - * Move uploaded file and provide source instance. - * - * @param Import $import - * @return Import\AbstractSource - * @throws LocalizedException - * @since 100.2.7 - */ - public function uploadFileAndGetSourceForRest(Import $import) - { - try { - $source = $import->_getSourceAdapterForApi(base64_decode($import->getData('csvData'))); - } catch (\Exception $e) { - $import->getVarDirectory()->delete($import->getVarDirectory()->getRelativePath($sourceFile)); - throw new LocalizedException(__($e->getMessage())); - } - return $source; - } } From fd4bd99d078be3650a3b32882e3c3c944dcaecdb Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 15 Jul 2022 14:20:20 -0500 Subject: [PATCH 28/57] ACPT-493: Upload csv with API request parameter --- .../Magento/ImportCsv/Model/SourceData.php | 23 +++++++++++-------- .../Magento/ImportExport/Model/Import.php | 3 +++ .../ImportExport/Model/Import/Source/Data.php | 7 ++++++ 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/ImportCsv/Model/SourceData.php b/app/code/Magento/ImportCsv/Model/SourceData.php index db38e630cbcb2..e8cc5a9a0dbd0 100644 --- a/app/code/Magento/ImportCsv/Model/SourceData.php +++ b/app/code/Magento/ImportCsv/Model/SourceData.php @@ -33,6 +33,11 @@ class SourceData extends AbstractSimpleObject implements SourceDataInterface */ private $allowedErrorCount; + /** + * @var string + */ + private $csvData; + /** * @inheritdoc */ @@ -65,6 +70,15 @@ public function getAllowedErrorCount(): string return $this->allowedErrorCount; } + /** + * @inheritDoc + */ + public function getCsvData() + { + return $this->csvData; + } + + /** * @inheritDoc */ @@ -104,13 +118,4 @@ public function setCsvData($csvData) { return $this->setData(self::PAYLOAD, $csvData); } - - /** - * @inheritDoc - */ - public function getCsvData() - { - return $this->csvData; - } - } diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index e6e690c5751cd..2876330feab61 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -336,6 +336,7 @@ protected function _getSourceAdapter($sourceFile) protected function _getSourceAdapterForApi() { return Adapter::findAdapterForData( + // phpcs:ignore Magento2.Functions.DiscouragedFunction base64_decode($this->getData('csvData')), $this->getData(self::FIELD_FIELD_SEPARATOR) ); @@ -599,6 +600,8 @@ public function uploadFileAndGetSource() } /** + * Get Source adapter object + * * @return AbstractSource */ public function getSourceForApiData() diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Data.php b/app/code/Magento/ImportExport/Model/Import/Source/Data.php index 2dfef601fcab7..8343456ed82ba 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Data.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Data.php @@ -19,10 +19,17 @@ class Data extends AbstractSource protected $_delimiter = ','; /** + * Field Enclosure character + * * @var string */ protected $_enclosure = ''; + /** + * Read Data and detect column names + * + * @param string $data + */ public function __construct(string $data) { $rowsData = preg_split("/\r\n|\n|\r/", $data); From 2da2544e9c852e599c3a135f70018601f6a7af2d Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 15 Jul 2022 14:24:35 -0500 Subject: [PATCH 29/57] ACPT-493: Upload csv with API request parameter --- app/code/Magento/CatalogImportExport/Model/Import/Product.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 405ebbc3dc7fc..637ce1b7a1211 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -226,7 +226,6 @@ class Product extends AbstractEntity * Links attribute name-to-link type ID. * * @deprecated 101.1.0 use DI for LinkProcessor class if you want to add additional types - * @see LinkProcessor * @var array */ protected $_linkNameToId = [ From 9d36d86e4c8097b8474940f3264b6f666b287917 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 15 Jul 2022 14:26:36 -0500 Subject: [PATCH 30/57] ACPT-493: Upload csv with API request parameter --- app/code/Magento/CatalogImportExport/Model/Import/Product.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 637ce1b7a1211..ac18211b44bd4 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -23,6 +23,7 @@ use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Driver\File; +use Magento\Framework\Filesystem\DriverPool; use Magento\Framework\Intl\DateTimeFactory; use Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor; use Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface; @@ -226,6 +227,7 @@ class Product extends AbstractEntity * Links attribute name-to-link type ID. * * @deprecated 101.1.0 use DI for LinkProcessor class if you want to add additional types + * * @var array */ protected $_linkNameToId = [ From aec7bab26ec05980d84e891394e147fc0ae431e9 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 15 Jul 2022 15:12:01 -0500 Subject: [PATCH 31/57] ACPT-493: Upload csv with API request parameter --- app/code/Magento/ImportCsv/Model/SourceData.php | 1 - .../Magento/ImportExport/Model/Import/Source/Data.php | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/ImportCsv/Model/SourceData.php b/app/code/Magento/ImportCsv/Model/SourceData.php index e8cc5a9a0dbd0..c1f1b95559908 100644 --- a/app/code/Magento/ImportCsv/Model/SourceData.php +++ b/app/code/Magento/ImportCsv/Model/SourceData.php @@ -78,7 +78,6 @@ public function getCsvData() return $this->csvData; } - /** * @inheritDoc */ diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Data.php b/app/code/Magento/ImportExport/Model/Import/Source/Data.php index 8343456ed82ba..141ba1caeb3e7 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Data.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Data.php @@ -11,6 +11,9 @@ class Data extends AbstractSource { + /** + * @var array + */ private $rows; /** @@ -38,6 +41,11 @@ public function __construct(string $data) parent::__construct($colNames); } + /** + * Read next line from CSV data + * + * @return array + */ protected function _getNextRow() { if ($this->_key===count($this->rows)) { From 67d9dde0a0ad3b9cdeb5e1527bd687db25fa463b Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Fri, 15 Jul 2022 18:30:32 -0500 Subject: [PATCH 32/57] ACPT-493: Upload csv with API request parameter --- app/code/Magento/ImportExport/Model/Import.php | 14 +++++++++++--- .../Magento/ImportExport/Model/Source/Upload.php | 6 ++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 2876330feab61..b51554881fe86 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -576,7 +576,15 @@ public function getErrorAggregator() */ public function uploadSource() { - return $this->upload->uploadSource($this); + $result = $this->upload->uploadSource($this); + $entity = $this->getEntity(); + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $extension = pathinfo($result['file'], PATHINFO_EXTENSION); + $sourceFile = $this->getWorkingDir() . $entity . '.' . $extension; + $sourceFileRelative = $this->getVarDirectory()->getRelativePath($sourceFile); + $this->_removeBom($sourceFile); + $this->createHistoryReport($sourceFileRelative, $entity, $extension, $result); + return $sourceFile; } /** @@ -626,7 +634,7 @@ public function getVarDirectory() * @return $this * @throws FileSystemException */ - public function _removeBom($sourceFile) + protected function _removeBom($sourceFile) { $driver = $this->_varDirectory->getDriver(); $string = $driver->fileGetContents($this->_varDirectory->getAbsolutePath($sourceFile)); @@ -809,7 +817,7 @@ public function isReportEntityType($entity = null) * @return $this * @throws LocalizedException */ - public function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) + protected function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) { if ($this->isReportEntityType($entity)) { if (is_array($sourceFileRelative)) { diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index a218abbf38a2c..ddace0404f2aa 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -63,7 +63,7 @@ public function __construct( * * @param Import $import * @throws LocalizedException - * @return string Source file path + * @return array */ public function uploadSource(Import $import) { @@ -122,8 +122,6 @@ public function uploadSource(Import $import) throw new LocalizedException(__('The source file moving process failed.')); } } - $import->_removeBom($sourceFile); - $import->createHistoryReport($sourceFileRelative, $entity, $extension, $result); - return $sourceFile; + return $result; } } From 2112d355363a26cc73fb01f19414584f78a0a2e2 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Sun, 17 Jul 2022 17:54:23 -0500 Subject: [PATCH 33/57] ACPT-493: Upload csv with request parameter Co-authored-by: Andrii Kasian --- app/code/Magento/ImportExport/Model/Source/Upload.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index ddace0404f2aa..f8cd92f48179f 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -55,8 +55,7 @@ public function __construct( $this->_httpFactory = $httpFactory; $this->_importExportData = $importExportData; $this->_uploaderFactory = $uploaderFactory; - $this->random = $random ?: ObjectManager::getInstance() - ->get(Random::class); + $this->random = $random; } /** * Move uploaded file. From 3c5e02a267deebacce72b5f35778fd9768c33348 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 18 Jul 2022 08:39:55 -0500 Subject: [PATCH 34/57] ACPT-493: Upload csv with API request parameter --- .../Magento/ImportExport/Model/Import.php | 2 +- .../ImportExport/Model/Source/Upload.php | 56 ++++++------------- .../MediaStorage/Model/File/Uploader.php | 52 ++++++++++++++++- 3 files changed, 68 insertions(+), 42 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index b51554881fe86..fbf8a44952d44 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -576,8 +576,8 @@ public function getErrorAggregator() */ public function uploadSource() { - $result = $this->upload->uploadSource($this); $entity = $this->getEntity(); + $result = $this->upload->uploadSource($entity); // phpcs:ignore Magento2.Functions.DiscouragedFunction $extension = pathinfo($result['file'], PATHINFO_EXTENSION); $sourceFile = $this->getWorkingDir() . $entity . '.' . $extension; diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index f8cd92f48179f..3ca7281c6636f 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -7,10 +7,10 @@ namespace Magento\ImportExport\Model\Source; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\Exception\FileSystemException; +use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Filesystem\Io\File; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Math\Random; use Magento\ImportExport\Helper\Data as DataHelper; @@ -40,31 +40,39 @@ class Upload */ private $random; + /** + * @var WriteInterface + */ + protected $_varDirectory; + /** * @param FileTransferFactory $httpFactory * @param DataHelper $importExportData * @param UploaderFactory $uploaderFactory * @param Random|null $random + * @param Filesystem $filesystem */ public function __construct( FileTransferFactory $httpFactory, DataHelper $importExportData, UploaderFactory $uploaderFactory, - Random $random + Random $random, + Filesystem $filesystem ) { $this->_httpFactory = $httpFactory; $this->_importExportData = $importExportData; $this->_uploaderFactory = $uploaderFactory; $this->random = $random; + $this->_varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); } /** * Move uploaded file. * - * @param Import $import + * @param string $entity * @throws LocalizedException * @return array */ - public function uploadSource(Import $import) + public function uploadSource(string $entity) { /** @var $adapter \Zend_File_Transfer_Adapter_Http */ $adapter = $this->_httpFactory->create(); @@ -78,49 +86,17 @@ public function uploadSource(Import $import) throw new LocalizedException($errorMessage); } - $entity = $import->getEntity(); /** @var $uploader Uploader */ $uploader = $this->_uploaderFactory->create(['fileId' => Import::FIELD_NAME_SOURCE_FILE]); $uploader->setAllowedExtensions(['csv', 'zip']); $uploader->skipDbProcessing(true); $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); try { - $result = $uploader->save($import->getWorkingDir(), $fileName); + $result = $uploader->save($this->_varDirectory->getAbsolutePath('importexport/'), $fileName); } catch (\Exception $e) { throw new LocalizedException(__('The file cannot be uploaded.')); } - - $extension = ''; - $uploadedFile = ''; - if ($result !== false) { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $extension = pathinfo($result['file'], PATHINFO_EXTENSION); - $uploadedFile = $result['path'] . $result['file']; - } - - if (!$extension) { - $import->getVarDirectory()->delete($uploadedFile); - throw new LocalizedException(__('The file you uploaded has no extension.')); - } - $sourceFile = $import->getWorkingDir() . $entity; - - $sourceFile .= '.' . $extension; - $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); - - if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($import->getVarDirectory()->isExist($sourceFileRelative)) { - $import->getVarDirectory()->delete($sourceFileRelative); - } - - try { - $import->getVarDirectory()->renameFile( - $import->getVarDirectory()->getRelativePath($uploadedFile), - $sourceFileRelative - ); - } catch (FileSystemException $e) { - throw new LocalizedException(__('The source file moving process failed.')); - } - } + $uploader->renameFile($entity); return $result; } } diff --git a/app/code/Magento/MediaStorage/Model/File/Uploader.php b/app/code/Magento/MediaStorage/Model/File/Uploader.php index 173211dfac011..5c7b1a2e0b365 100644 --- a/app/code/Magento/MediaStorage/Model/File/Uploader.php +++ b/app/code/Magento/MediaStorage/Model/File/Uploader.php @@ -6,7 +6,10 @@ namespace Magento\MediaStorage\Model\File; +use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\FileSystemException; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Validation\ValidationException; use Magento\MediaStorage\Model\File\Validator\Image; @@ -49,21 +52,29 @@ class Uploader extends \Magento\Framework\File\Uploader */ private $imageValidator; + /** + * @var \Magento\Framework\Filesystem\Directory\WriteInterface + */ + protected $_varDirectory; + /** * @param string $fileId * @param \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\MediaStorage\Helper\File\Storage $coreFileStorage * @param \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator + * @param \Magento\Framework\Filesystem $filesystem */ public function __construct( $fileId, \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDb, \Magento\MediaStorage\Helper\File\Storage $coreFileStorage, - \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator + \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator, + \Magento\Framework\Filesystem $filesystem ) { $this->_coreFileStorageDb = $coreFileStorageDb; $this->_coreFileStorage = $coreFileStorage; $this->_validator = $validator; + $this->_varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); parent::__construct($fileId); } @@ -140,6 +151,45 @@ public function validateFile() return $this->_file; } + /** + * @return void + * @throws LocalizedException + */ + public function renameFile(string $entity) + { + $extension = ''; + $uploadedFile = ''; + if ($this->_result !== false) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $extension = pathinfo($this->_result['file'], PATHINFO_EXTENSION); + $uploadedFile = $this->_result['path'] . $this->_result['file']; + } + + if (!$extension) { + $this->_varDirectory->delete($uploadedFile); + throw new LocalizedException(__('The file you uploaded has no extension.')); + } + $sourceFile = $this->_varDirectory->getAbsolutePath('importexport/') . $entity; + + $sourceFile .= '.' . $extension; + $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); + + if (strtolower($uploadedFile) != strtolower($sourceFile)) { + if ($this->_varDirectory->isExist($sourceFileRelative)) { + $this->_varDirectory->delete($sourceFileRelative); + } + + try { + $this->_varDirectory->renameFile( + $this->_varDirectory->getRelativePath($uploadedFile), + $sourceFileRelative + ); + } catch (FileSystemException $e) { + throw new LocalizedException(__('The source file moving process failed.')); + } + } + } + /** * @inheritDoc * @since 100.4.0 From 4296a2ad6dd8c1d96bea412a46158f1f5921f9f7 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 18 Jul 2022 12:15:23 -0500 Subject: [PATCH 35/57] ACPT-493: Upload csv with API request parameter --- .../Model/Import/Product.php | 3 +- .../Magento/ImportCsv/Model/SourceData.php | 22 +++---- .../Magento/ImportExport/Model/Import.php | 17 +---- .../ImportExport/Model/Import/Source/Data.php | 15 ----- .../ImportExport/Model/Source/Upload.php | 65 +++++++++++++------ .../MediaStorage/Model/File/Uploader.php | 52 +-------------- 6 files changed, 60 insertions(+), 114 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index ac18211b44bd4..405ebbc3dc7fc 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -23,7 +23,6 @@ use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Driver\File; -use Magento\Framework\Filesystem\DriverPool; use Magento\Framework\Intl\DateTimeFactory; use Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor; use Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface; @@ -227,7 +226,7 @@ class Product extends AbstractEntity * Links attribute name-to-link type ID. * * @deprecated 101.1.0 use DI for LinkProcessor class if you want to add additional types - * + * @see LinkProcessor * @var array */ protected $_linkNameToId = [ diff --git a/app/code/Magento/ImportCsv/Model/SourceData.php b/app/code/Magento/ImportCsv/Model/SourceData.php index c1f1b95559908..db38e630cbcb2 100644 --- a/app/code/Magento/ImportCsv/Model/SourceData.php +++ b/app/code/Magento/ImportCsv/Model/SourceData.php @@ -33,11 +33,6 @@ class SourceData extends AbstractSimpleObject implements SourceDataInterface */ private $allowedErrorCount; - /** - * @var string - */ - private $csvData; - /** * @inheritdoc */ @@ -70,14 +65,6 @@ public function getAllowedErrorCount(): string return $this->allowedErrorCount; } - /** - * @inheritDoc - */ - public function getCsvData() - { - return $this->csvData; - } - /** * @inheritDoc */ @@ -117,4 +104,13 @@ public function setCsvData($csvData) { return $this->setData(self::PAYLOAD, $csvData); } + + /** + * @inheritDoc + */ + public function getCsvData() + { + return $this->csvData; + } + } diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index fbf8a44952d44..e6e690c5751cd 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -336,7 +336,6 @@ protected function _getSourceAdapter($sourceFile) protected function _getSourceAdapterForApi() { return Adapter::findAdapterForData( - // phpcs:ignore Magento2.Functions.DiscouragedFunction base64_decode($this->getData('csvData')), $this->getData(self::FIELD_FIELD_SEPARATOR) ); @@ -576,15 +575,7 @@ public function getErrorAggregator() */ public function uploadSource() { - $entity = $this->getEntity(); - $result = $this->upload->uploadSource($entity); - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $extension = pathinfo($result['file'], PATHINFO_EXTENSION); - $sourceFile = $this->getWorkingDir() . $entity . '.' . $extension; - $sourceFileRelative = $this->getVarDirectory()->getRelativePath($sourceFile); - $this->_removeBom($sourceFile); - $this->createHistoryReport($sourceFileRelative, $entity, $extension, $result); - return $sourceFile; + return $this->upload->uploadSource($this); } /** @@ -608,8 +599,6 @@ public function uploadFileAndGetSource() } /** - * Get Source adapter object - * * @return AbstractSource */ public function getSourceForApiData() @@ -634,7 +623,7 @@ public function getVarDirectory() * @return $this * @throws FileSystemException */ - protected function _removeBom($sourceFile) + public function _removeBom($sourceFile) { $driver = $this->_varDirectory->getDriver(); $string = $driver->fileGetContents($this->_varDirectory->getAbsolutePath($sourceFile)); @@ -817,7 +806,7 @@ public function isReportEntityType($entity = null) * @return $this * @throws LocalizedException */ - protected function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) + public function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) { if ($this->isReportEntityType($entity)) { if (is_array($sourceFileRelative)) { diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Data.php b/app/code/Magento/ImportExport/Model/Import/Source/Data.php index 141ba1caeb3e7..2dfef601fcab7 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Data.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Data.php @@ -11,9 +11,6 @@ class Data extends AbstractSource { - /** - * @var array - */ private $rows; /** @@ -22,17 +19,10 @@ class Data extends AbstractSource protected $_delimiter = ','; /** - * Field Enclosure character - * * @var string */ protected $_enclosure = ''; - /** - * Read Data and detect column names - * - * @param string $data - */ public function __construct(string $data) { $rowsData = preg_split("/\r\n|\n|\r/", $data); @@ -41,11 +31,6 @@ public function __construct(string $data) parent::__construct($colNames); } - /** - * Read next line from CSV data - * - * @return array - */ protected function _getNextRow() { if ($this->_key===count($this->rows)) { diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index 3ca7281c6636f..a218abbf38a2c 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -7,10 +7,10 @@ namespace Magento\ImportExport\Model\Source; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Filesystem; -use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\Framework\Filesystem\Io\File; use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Math\Random; use Magento\ImportExport\Helper\Data as DataHelper; @@ -40,39 +40,32 @@ class Upload */ private $random; - /** - * @var WriteInterface - */ - protected $_varDirectory; - /** * @param FileTransferFactory $httpFactory * @param DataHelper $importExportData * @param UploaderFactory $uploaderFactory * @param Random|null $random - * @param Filesystem $filesystem */ public function __construct( FileTransferFactory $httpFactory, DataHelper $importExportData, UploaderFactory $uploaderFactory, - Random $random, - Filesystem $filesystem + Random $random ) { $this->_httpFactory = $httpFactory; $this->_importExportData = $importExportData; $this->_uploaderFactory = $uploaderFactory; - $this->random = $random; - $this->_varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); + $this->random = $random ?: ObjectManager::getInstance() + ->get(Random::class); } /** * Move uploaded file. * - * @param string $entity + * @param Import $import * @throws LocalizedException - * @return array + * @return string Source file path */ - public function uploadSource(string $entity) + public function uploadSource(Import $import) { /** @var $adapter \Zend_File_Transfer_Adapter_Http */ $adapter = $this->_httpFactory->create(); @@ -86,17 +79,51 @@ public function uploadSource(string $entity) throw new LocalizedException($errorMessage); } + $entity = $import->getEntity(); /** @var $uploader Uploader */ $uploader = $this->_uploaderFactory->create(['fileId' => Import::FIELD_NAME_SOURCE_FILE]); $uploader->setAllowedExtensions(['csv', 'zip']); $uploader->skipDbProcessing(true); $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); try { - $result = $uploader->save($this->_varDirectory->getAbsolutePath('importexport/'), $fileName); + $result = $uploader->save($import->getWorkingDir(), $fileName); } catch (\Exception $e) { throw new LocalizedException(__('The file cannot be uploaded.')); } - $uploader->renameFile($entity); - return $result; + + $extension = ''; + $uploadedFile = ''; + if ($result !== false) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $extension = pathinfo($result['file'], PATHINFO_EXTENSION); + $uploadedFile = $result['path'] . $result['file']; + } + + if (!$extension) { + $import->getVarDirectory()->delete($uploadedFile); + throw new LocalizedException(__('The file you uploaded has no extension.')); + } + $sourceFile = $import->getWorkingDir() . $entity; + + $sourceFile .= '.' . $extension; + $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); + + if (strtolower($uploadedFile) != strtolower($sourceFile)) { + if ($import->getVarDirectory()->isExist($sourceFileRelative)) { + $import->getVarDirectory()->delete($sourceFileRelative); + } + + try { + $import->getVarDirectory()->renameFile( + $import->getVarDirectory()->getRelativePath($uploadedFile), + $sourceFileRelative + ); + } catch (FileSystemException $e) { + throw new LocalizedException(__('The source file moving process failed.')); + } + } + $import->_removeBom($sourceFile); + $import->createHistoryReport($sourceFileRelative, $entity, $extension, $result); + return $sourceFile; } } diff --git a/app/code/Magento/MediaStorage/Model/File/Uploader.php b/app/code/Magento/MediaStorage/Model/File/Uploader.php index 5c7b1a2e0b365..173211dfac011 100644 --- a/app/code/Magento/MediaStorage/Model/File/Uploader.php +++ b/app/code/Magento/MediaStorage/Model/File/Uploader.php @@ -6,10 +6,7 @@ namespace Magento\MediaStorage\Model\File; -use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\ObjectManager; -use Magento\Framework\Exception\FileSystemException; -use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Validation\ValidationException; use Magento\MediaStorage\Model\File\Validator\Image; @@ -52,29 +49,21 @@ class Uploader extends \Magento\Framework\File\Uploader */ private $imageValidator; - /** - * @var \Magento\Framework\Filesystem\Directory\WriteInterface - */ - protected $_varDirectory; - /** * @param string $fileId * @param \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\MediaStorage\Helper\File\Storage $coreFileStorage * @param \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator - * @param \Magento\Framework\Filesystem $filesystem */ public function __construct( $fileId, \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDb, \Magento\MediaStorage\Helper\File\Storage $coreFileStorage, - \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator, - \Magento\Framework\Filesystem $filesystem + \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator ) { $this->_coreFileStorageDb = $coreFileStorageDb; $this->_coreFileStorage = $coreFileStorage; $this->_validator = $validator; - $this->_varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); parent::__construct($fileId); } @@ -151,45 +140,6 @@ public function validateFile() return $this->_file; } - /** - * @return void - * @throws LocalizedException - */ - public function renameFile(string $entity) - { - $extension = ''; - $uploadedFile = ''; - if ($this->_result !== false) { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $extension = pathinfo($this->_result['file'], PATHINFO_EXTENSION); - $uploadedFile = $this->_result['path'] . $this->_result['file']; - } - - if (!$extension) { - $this->_varDirectory->delete($uploadedFile); - throw new LocalizedException(__('The file you uploaded has no extension.')); - } - $sourceFile = $this->_varDirectory->getAbsolutePath('importexport/') . $entity; - - $sourceFile .= '.' . $extension; - $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); - - if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($this->_varDirectory->isExist($sourceFileRelative)) { - $this->_varDirectory->delete($sourceFileRelative); - } - - try { - $this->_varDirectory->renameFile( - $this->_varDirectory->getRelativePath($uploadedFile), - $sourceFileRelative - ); - } catch (FileSystemException $e) { - throw new LocalizedException(__('The source file moving process failed.')); - } - } - } - /** * @inheritDoc * @since 100.4.0 From 3599559d0d2e5481dc36e8cc5607e025c9105b6d Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 18 Jul 2022 13:26:24 -0500 Subject: [PATCH 36/57] ACPT-493: Upload csv with API request parameter --- .../Model/Import/Product.php | 3 +- .../Magento/ImportCsv/Model/SourceData.php | 22 ++++--- .../Magento/ImportExport/Model/Import.php | 17 ++++- .../ImportExport/Model/Import/Source/Data.php | 15 +++++ .../ImportExport/Model/Source/Upload.php | 65 ++++++------------- .../MediaStorage/Model/File/Uploader.php | 52 ++++++++++++++- 6 files changed, 114 insertions(+), 60 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 405ebbc3dc7fc..ac18211b44bd4 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -23,6 +23,7 @@ use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Driver\File; +use Magento\Framework\Filesystem\DriverPool; use Magento\Framework\Intl\DateTimeFactory; use Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor; use Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface; @@ -226,7 +227,7 @@ class Product extends AbstractEntity * Links attribute name-to-link type ID. * * @deprecated 101.1.0 use DI for LinkProcessor class if you want to add additional types - * @see LinkProcessor + * * @var array */ protected $_linkNameToId = [ diff --git a/app/code/Magento/ImportCsv/Model/SourceData.php b/app/code/Magento/ImportCsv/Model/SourceData.php index db38e630cbcb2..c1f1b95559908 100644 --- a/app/code/Magento/ImportCsv/Model/SourceData.php +++ b/app/code/Magento/ImportCsv/Model/SourceData.php @@ -33,6 +33,11 @@ class SourceData extends AbstractSimpleObject implements SourceDataInterface */ private $allowedErrorCount; + /** + * @var string + */ + private $csvData; + /** * @inheritdoc */ @@ -65,6 +70,14 @@ public function getAllowedErrorCount(): string return $this->allowedErrorCount; } + /** + * @inheritDoc + */ + public function getCsvData() + { + return $this->csvData; + } + /** * @inheritDoc */ @@ -104,13 +117,4 @@ public function setCsvData($csvData) { return $this->setData(self::PAYLOAD, $csvData); } - - /** - * @inheritDoc - */ - public function getCsvData() - { - return $this->csvData; - } - } diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index e6e690c5751cd..fbf8a44952d44 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -336,6 +336,7 @@ protected function _getSourceAdapter($sourceFile) protected function _getSourceAdapterForApi() { return Adapter::findAdapterForData( + // phpcs:ignore Magento2.Functions.DiscouragedFunction base64_decode($this->getData('csvData')), $this->getData(self::FIELD_FIELD_SEPARATOR) ); @@ -575,7 +576,15 @@ public function getErrorAggregator() */ public function uploadSource() { - return $this->upload->uploadSource($this); + $entity = $this->getEntity(); + $result = $this->upload->uploadSource($entity); + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $extension = pathinfo($result['file'], PATHINFO_EXTENSION); + $sourceFile = $this->getWorkingDir() . $entity . '.' . $extension; + $sourceFileRelative = $this->getVarDirectory()->getRelativePath($sourceFile); + $this->_removeBom($sourceFile); + $this->createHistoryReport($sourceFileRelative, $entity, $extension, $result); + return $sourceFile; } /** @@ -599,6 +608,8 @@ public function uploadFileAndGetSource() } /** + * Get Source adapter object + * * @return AbstractSource */ public function getSourceForApiData() @@ -623,7 +634,7 @@ public function getVarDirectory() * @return $this * @throws FileSystemException */ - public function _removeBom($sourceFile) + protected function _removeBom($sourceFile) { $driver = $this->_varDirectory->getDriver(); $string = $driver->fileGetContents($this->_varDirectory->getAbsolutePath($sourceFile)); @@ -806,7 +817,7 @@ public function isReportEntityType($entity = null) * @return $this * @throws LocalizedException */ - public function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) + protected function createHistoryReport($sourceFileRelative, $entity, $extension = null, $result = null) { if ($this->isReportEntityType($entity)) { if (is_array($sourceFileRelative)) { diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Data.php b/app/code/Magento/ImportExport/Model/Import/Source/Data.php index 2dfef601fcab7..141ba1caeb3e7 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Data.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Data.php @@ -11,6 +11,9 @@ class Data extends AbstractSource { + /** + * @var array + */ private $rows; /** @@ -19,10 +22,17 @@ class Data extends AbstractSource protected $_delimiter = ','; /** + * Field Enclosure character + * * @var string */ protected $_enclosure = ''; + /** + * Read Data and detect column names + * + * @param string $data + */ public function __construct(string $data) { $rowsData = preg_split("/\r\n|\n|\r/", $data); @@ -31,6 +41,11 @@ public function __construct(string $data) parent::__construct($colNames); } + /** + * Read next line from CSV data + * + * @return array + */ protected function _getNextRow() { if ($this->_key===count($this->rows)) { diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index a218abbf38a2c..3ca7281c6636f 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -7,10 +7,10 @@ namespace Magento\ImportExport\Model\Source; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\Exception\FileSystemException; +use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\Filesystem\Io\File; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Math\Random; use Magento\ImportExport\Helper\Data as DataHelper; @@ -40,32 +40,39 @@ class Upload */ private $random; + /** + * @var WriteInterface + */ + protected $_varDirectory; + /** * @param FileTransferFactory $httpFactory * @param DataHelper $importExportData * @param UploaderFactory $uploaderFactory * @param Random|null $random + * @param Filesystem $filesystem */ public function __construct( FileTransferFactory $httpFactory, DataHelper $importExportData, UploaderFactory $uploaderFactory, - Random $random + Random $random, + Filesystem $filesystem ) { $this->_httpFactory = $httpFactory; $this->_importExportData = $importExportData; $this->_uploaderFactory = $uploaderFactory; - $this->random = $random ?: ObjectManager::getInstance() - ->get(Random::class); + $this->random = $random; + $this->_varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); } /** * Move uploaded file. * - * @param Import $import + * @param string $entity * @throws LocalizedException - * @return string Source file path + * @return array */ - public function uploadSource(Import $import) + public function uploadSource(string $entity) { /** @var $adapter \Zend_File_Transfer_Adapter_Http */ $adapter = $this->_httpFactory->create(); @@ -79,51 +86,17 @@ public function uploadSource(Import $import) throw new LocalizedException($errorMessage); } - $entity = $import->getEntity(); /** @var $uploader Uploader */ $uploader = $this->_uploaderFactory->create(['fileId' => Import::FIELD_NAME_SOURCE_FILE]); $uploader->setAllowedExtensions(['csv', 'zip']); $uploader->skipDbProcessing(true); $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); try { - $result = $uploader->save($import->getWorkingDir(), $fileName); + $result = $uploader->save($this->_varDirectory->getAbsolutePath('importexport/'), $fileName); } catch (\Exception $e) { throw new LocalizedException(__('The file cannot be uploaded.')); } - - $extension = ''; - $uploadedFile = ''; - if ($result !== false) { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $extension = pathinfo($result['file'], PATHINFO_EXTENSION); - $uploadedFile = $result['path'] . $result['file']; - } - - if (!$extension) { - $import->getVarDirectory()->delete($uploadedFile); - throw new LocalizedException(__('The file you uploaded has no extension.')); - } - $sourceFile = $import->getWorkingDir() . $entity; - - $sourceFile .= '.' . $extension; - $sourceFileRelative = $import->getVarDirectory()->getRelativePath($sourceFile); - - if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($import->getVarDirectory()->isExist($sourceFileRelative)) { - $import->getVarDirectory()->delete($sourceFileRelative); - } - - try { - $import->getVarDirectory()->renameFile( - $import->getVarDirectory()->getRelativePath($uploadedFile), - $sourceFileRelative - ); - } catch (FileSystemException $e) { - throw new LocalizedException(__('The source file moving process failed.')); - } - } - $import->_removeBom($sourceFile); - $import->createHistoryReport($sourceFileRelative, $entity, $extension, $result); - return $sourceFile; + $uploader->renameFile($entity); + return $result; } } diff --git a/app/code/Magento/MediaStorage/Model/File/Uploader.php b/app/code/Magento/MediaStorage/Model/File/Uploader.php index 173211dfac011..5c7b1a2e0b365 100644 --- a/app/code/Magento/MediaStorage/Model/File/Uploader.php +++ b/app/code/Magento/MediaStorage/Model/File/Uploader.php @@ -6,7 +6,10 @@ namespace Magento\MediaStorage\Model\File; +use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\FileSystemException; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Validation\ValidationException; use Magento\MediaStorage\Model\File\Validator\Image; @@ -49,21 +52,29 @@ class Uploader extends \Magento\Framework\File\Uploader */ private $imageValidator; + /** + * @var \Magento\Framework\Filesystem\Directory\WriteInterface + */ + protected $_varDirectory; + /** * @param string $fileId * @param \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\MediaStorage\Helper\File\Storage $coreFileStorage * @param \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator + * @param \Magento\Framework\Filesystem $filesystem */ public function __construct( $fileId, \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDb, \Magento\MediaStorage\Helper\File\Storage $coreFileStorage, - \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator + \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator, + \Magento\Framework\Filesystem $filesystem ) { $this->_coreFileStorageDb = $coreFileStorageDb; $this->_coreFileStorage = $coreFileStorage; $this->_validator = $validator; + $this->_varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); parent::__construct($fileId); } @@ -140,6 +151,45 @@ public function validateFile() return $this->_file; } + /** + * @return void + * @throws LocalizedException + */ + public function renameFile(string $entity) + { + $extension = ''; + $uploadedFile = ''; + if ($this->_result !== false) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $extension = pathinfo($this->_result['file'], PATHINFO_EXTENSION); + $uploadedFile = $this->_result['path'] . $this->_result['file']; + } + + if (!$extension) { + $this->_varDirectory->delete($uploadedFile); + throw new LocalizedException(__('The file you uploaded has no extension.')); + } + $sourceFile = $this->_varDirectory->getAbsolutePath('importexport/') . $entity; + + $sourceFile .= '.' . $extension; + $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); + + if (strtolower($uploadedFile) != strtolower($sourceFile)) { + if ($this->_varDirectory->isExist($sourceFileRelative)) { + $this->_varDirectory->delete($sourceFileRelative); + } + + try { + $this->_varDirectory->renameFile( + $this->_varDirectory->getRelativePath($uploadedFile), + $sourceFileRelative + ); + } catch (FileSystemException $e) { + throw new LocalizedException(__('The source file moving process failed.')); + } + } + } + /** * @inheritDoc * @since 100.4.0 From f38d587542918e06f1c3f709ddb9f783dce43420 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 18 Jul 2022 13:31:04 -0500 Subject: [PATCH 37/57] ACPT-493: Upload csv with API request parameter --- app/code/Magento/MediaStorage/Model/File/Uploader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/MediaStorage/Model/File/Uploader.php b/app/code/Magento/MediaStorage/Model/File/Uploader.php index 5c7b1a2e0b365..c6e1f09c4b029 100644 --- a/app/code/Magento/MediaStorage/Model/File/Uploader.php +++ b/app/code/Magento/MediaStorage/Model/File/Uploader.php @@ -29,7 +29,7 @@ class Uploader extends \Magento\Framework\File\Uploader protected $_skipDbProcessing = false; /** - * Core file storage + * File storage * * @var \Magento\MediaStorage\Helper\File\Storage */ @@ -152,6 +152,9 @@ public function validateFile() } /** + * Rename Uploaded File + * + * @param string $entity * @return void * @throws LocalizedException */ From a6c3cb6358ba3e6ed9ed816dce3e966f621bad0b Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 18 Jul 2022 17:08:38 -0500 Subject: [PATCH 38/57] ACPT-648: Cover API with Webapi Test --- .../Magento/ImportExport/Model/Import.php | 2 +- .../ImportCsv/Api/ImportCsvApiTest.php | 75 +++++++++++++++++++ .../ImportCsv/Api/_files/advanced_pricing.csv | 2 + .../ImportCsv/Api/_files/customers.csv | 4 + .../Magento/ImportCsv/Api/_files/products.csv | 4 + 5 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php create mode 100644 dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/advanced_pricing.csv create mode 100644 dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/customers.csv create mode 100755 dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/products.csv diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index fbf8a44952d44..fb2aacf3b114c 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -337,7 +337,7 @@ protected function _getSourceAdapterForApi() { return Adapter::findAdapterForData( // phpcs:ignore Magento2.Functions.DiscouragedFunction - base64_decode($this->getData('csvData')), + trim(base64_decode($this->getData('csvData'))), $this->getData(self::FIELD_FIELD_SEPARATOR) ); } diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php new file mode 100644 index 0000000000000..a46936b2b7232 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php @@ -0,0 +1,75 @@ + [ + 'resourcePath' => self::RESOURCE_PATH, + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST, + ] + ]; + $requestData['source']['csvData'] = base64_encode(file_get_contents($requestData['source']['csvData'])); + $response = $this->_webApiCall($serviceInfo, $requestData); + $this->assertEquals($expectedResponse, $response); + } + + /** + * @return array + */ + public function getRequestData(): array + { + return [ + ['requestData' => [ + 'source' => [ + 'entity' => 'catalog_product', + 'behavior' => 'append', + 'validationStrategy' => 'validation-stop-on-errors', + 'allowedErrorCount' => '10', + 'csvData' => __DIR__ . '/_files/products.csv' + ] + ], + 'expectedResponse' => [ + 0 => 'Entities Processed: 3' + ]], + ['requestData' => [ + 'source' => [ + 'entity' => 'customer', + 'behavior' => 'add_update', + 'validationStrategy' => 'validation-stop-on-errors', + 'allowedErrorCount' => '10', + 'csvData' => __DIR__ . '/_files/customers.csv' + ] + ], + 'expectedResponse' => [ + 0 => 'Entities Processed: 3' + ]], + ['requestData' => [ + 'source' => [ + 'entity' => 'advanced_pricing', + 'behavior' => 'append', + 'validationStrategy' => 'validation-stop-on-errors', + 'allowedErrorCount' => '10', + 'csvData' => __DIR__ . '/_files/advanced_pricing.csv' + ] + ], + 'expectedResponse' => [ + 0 => 'Entities Processed: 1' + ]] + ]; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/advanced_pricing.csv b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/advanced_pricing.csv new file mode 100644 index 0000000000000..70b101c44bab7 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/advanced_pricing.csv @@ -0,0 +1,2 @@ +sku,tier_price_website,tier_price_customer_group,tier_price_qty,tier_price,tier_price_value_type +Simple1,"All Websites [USD]","NOT LOGGED IN",1.0000,250.000000,Fixed diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/customers.csv b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/customers.csv new file mode 100644 index 0000000000000..5f4e944e99c10 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/customers.csv @@ -0,0 +1,4 @@ +email,_website,_store,website_id,store_id,created_in,prefix,firstname,middlename,lastname,suffix,group_id,dob,password_hash,rp_token,rp_token_created_at,taxvat,confirmation,created_at,gender,disable_auto_group_change,updated_at,failures_num,first_failure,lock_expires,reward_update_notification,reward_warning_notification,password +c@1.com,base,default,1,1,"Default Store View",,C1,,C1L,,1,,,0:3:Odhon9E4VktVZ/Qkb7TlfCvYZaQgCTM+LzSuPP4ox++7j0Ne4s52gQMK35vccWuDBosZxmrA96amJBzt,"2022-06-21 18:44:18",,,"2022-06-21 18:44:18",0,0,"2022-06-21 18:44:18",0,,,0,0, +c@2.com,base,default,1,1,"Default Store View",,C2,,C2L,,1,,,0:3:Adc2mk3JhzRppiaWZlSa3NHQ30Nzhz0LtKp/P76nkiz/FAllmygux+1xvHPrnLnpMIbRVX6ti8YGluzO,"2022-06-21 18:44:42",,,"2022-06-21 18:44:42",0,0,"2022-06-21 18:44:42",0,,,0,0, +C@3.com,base,default,1,1,"Default Store View",,C3,,C3L,,1,,,0:3:h3x6Qh6DsMuLQiFCZCaQvCR+CNGEqzEqg5g4mjecDElHdQtbUUx5dV+CIssHvah1fwY6THxJkRiqHDCg,"2022-06-21 18:45:08",,,"2022-06-21 18:45:08",0,0,"2022-06-21 18:45:08",0,,,0,0, diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/products.csv b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/products.csv new file mode 100755 index 0000000000000..6bc62e52c3fa9 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/products.csv @@ -0,0 +1,4 @@ +sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,related_position,crosssell_skus,crosssell_position,upsell_skus,upsell_position,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,bundle_shipment_type,associated_skus,downloadable_links,downloadable_samples,configurable_variations,configurable_variation_labels +Simple1,,Default,simple,"Default Category",base,Simple1,,,1.000000,1,"Taxable Goods","Catalog, Search",10.000000,,,,simple1,Simple1,Simple1,"Simple1 ",,,,,,,,,"6/7/22, 3:15 PM","6/7/22, 3:15 PM",,,"Block after Info Column",,,,"Use config",,,,,,,"Use config","United States",,1000.0000,0.0000,1,0,0,1,1.0000,1,10000.0000,1,1,1.0000,1,1,1,1,1.0000,1,0,0,0,,,,,,,,,,,,,,,,,,,,, +Simple2,,Default,simple,"Default Category",base,Simple2,,,1.000000,1,"Taxable Goods","Catalog, Search",200.000000,,,,simple2,Simple2,Simple2,"Simple2 ",,,,,,,,,"6/7/22, 3:16 PM","6/7/22, 3:16 PM",,,"Block after Info Column",,,,"Use config",,,,,,,"Use config","United States",,1000.0000,0.0000,1,0,0,1,1.0000,1,10000.0000,1,1,1.0000,1,1,1,1,1.0000,1,0,0,0,,,,,,,,,,,,,,,,,,,,, +Simple3,,Default,simple,"Default Category",base,Simple3,,,1.000000,1,"Taxable Goods","Catalog, Search",300.000000,,,,simple3,Simple3,Simple3,"Simple3 ",,,,,,,,,"6/7/22, 3:16 PM","6/7/22, 3:16 PM",,,"Block after Info Column",,,,"Use config",,,,,,,"Use config","United States",,1000.0000,0.0000,1,0,0,1,1.0000,1,10000.0000,1,1,1.0000,1,1,1,1,1.0000,1,0,0,0,,,,,,,,,,,,,,,,,,,,, From a9e3067bade58cbd94a4c989e383b937cd003316 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 18 Jul 2022 19:04:45 -0500 Subject: [PATCH 39/57] ACPT-648: Cover API with Webapi Test --- .../Magento/ImportCsv/Api/ImportCsvApiTest.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php index a46936b2b7232..93f117c11bc48 100644 --- a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php +++ b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php @@ -1,4 +1,10 @@ [ 'resourcePath' => self::RESOURCE_PATH, 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Save', ] ]; $requestData['source']['csvData'] = base64_encode(file_get_contents($requestData['source']['csvData'])); From 485f4b19e5df043a9ba90c7cbf52e8a9715df4b9 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 18 Jul 2022 21:39:18 -0500 Subject: [PATCH 40/57] ACPT-648: Cover API with Webapi Test --- .../testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php index 93f117c11bc48..301d5d7772fb8 100644 --- a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php +++ b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php @@ -13,7 +13,7 @@ class ImportCsvApiTest extends WebapiAbstract { private const RESOURCE_PATH = '/V1/import/csv'; - private const SERVICE_NAME = 'importCsvV1'; + private const SERVICE_NAME = 'importCsvApiStartImportV1'; private const SERVICE_VERSION = 'V1'; /** @@ -33,7 +33,7 @@ public function testImport(array $requestData, array $expectedResponse): void 'soap' => [ 'service' => self::SERVICE_NAME, 'serviceVersion' => self::SERVICE_VERSION, - 'operation' => self::SERVICE_NAME . 'Save', + 'operation' => self::SERVICE_NAME . 'Execute' ] ]; $requestData['source']['csvData'] = base64_encode(file_get_contents($requestData['source']['csvData'])); From d43a59cbe8b0ed8da1f5e0a2389a590d7ab6ec1a Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 18 Jul 2022 23:41:38 -0500 Subject: [PATCH 41/57] ACPT-648: Cover API with Webapi Test --- .../testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php index 301d5d7772fb8..9cbeeb6d6b760 100644 --- a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php +++ b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php @@ -38,7 +38,7 @@ public function testImport(array $requestData, array $expectedResponse): void ]; $requestData['source']['csvData'] = base64_encode(file_get_contents($requestData['source']['csvData'])); $response = $this->_webApiCall($serviceInfo, $requestData); - $this->assertEquals($expectedResponse, $response); + $this->assertEquals($expectedResponse, array_values($response)); } /** From 3aa62fa6923fb288230e6488911e09802fb5e7f5 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 19 Jul 2022 01:02:35 -0500 Subject: [PATCH 42/57] ACPT-648: Cover API with Webapi Test --- .../Magento/ImportCsv/Api/ImportCsvApiTest.php | 12 ------------ .../Magento/ImportCsv/Api/_files/customers.csv | 4 ---- 2 files changed, 16 deletions(-) delete mode 100644 dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/customers.csv diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php index 9cbeeb6d6b760..1dcedf41d181e 100644 --- a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php +++ b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php @@ -59,18 +59,6 @@ public function getRequestData(): array 'expectedResponse' => [ 0 => 'Entities Processed: 3' ]], - ['requestData' => [ - 'source' => [ - 'entity' => 'customer', - 'behavior' => 'add_update', - 'validationStrategy' => 'validation-stop-on-errors', - 'allowedErrorCount' => '10', - 'csvData' => __DIR__ . '/_files/customers.csv' - ] - ], - 'expectedResponse' => [ - 0 => 'Entities Processed: 3' - ]], ['requestData' => [ 'source' => [ 'entity' => 'advanced_pricing', diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/customers.csv b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/customers.csv deleted file mode 100644 index 5f4e944e99c10..0000000000000 --- a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/customers.csv +++ /dev/null @@ -1,4 +0,0 @@ -email,_website,_store,website_id,store_id,created_in,prefix,firstname,middlename,lastname,suffix,group_id,dob,password_hash,rp_token,rp_token_created_at,taxvat,confirmation,created_at,gender,disable_auto_group_change,updated_at,failures_num,first_failure,lock_expires,reward_update_notification,reward_warning_notification,password -c@1.com,base,default,1,1,"Default Store View",,C1,,C1L,,1,,,0:3:Odhon9E4VktVZ/Qkb7TlfCvYZaQgCTM+LzSuPP4ox++7j0Ne4s52gQMK35vccWuDBosZxmrA96amJBzt,"2022-06-21 18:44:18",,,"2022-06-21 18:44:18",0,0,"2022-06-21 18:44:18",0,,,0,0, -c@2.com,base,default,1,1,"Default Store View",,C2,,C2L,,1,,,0:3:Adc2mk3JhzRppiaWZlSa3NHQ30Nzhz0LtKp/P76nkiz/FAllmygux+1xvHPrnLnpMIbRVX6ti8YGluzO,"2022-06-21 18:44:42",,,"2022-06-21 18:44:42",0,0,"2022-06-21 18:44:42",0,,,0,0, -C@3.com,base,default,1,1,"Default Store View",,C3,,C3L,,1,,,0:3:h3x6Qh6DsMuLQiFCZCaQvCR+CNGEqzEqg5g4mjecDElHdQtbUUx5dV+CIssHvah1fwY6THxJkRiqHDCg,"2022-06-21 18:45:08",,,"2022-06-21 18:45:08",0,0,"2022-06-21 18:45:08",0,,,0,0, From a5e2370bd533448eda526489ad2e1802daacd309 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 19 Jul 2022 01:10:39 -0500 Subject: [PATCH 43/57] ACPT-493: Upload csv with request parameter --- app/code/Magento/ImportExport/Model/Import.php | 10 ---------- app/code/Magento/ImportExport/Model/Import/Adapter.php | 2 +- .../Source/{Data.php => Base64EncodedCsvData.php} | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) rename app/code/Magento/ImportExport/Model/Import/Source/{Data.php => Base64EncodedCsvData.php} (96%) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index fb2aacf3b114c..22e01e366f7cd 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -193,12 +193,6 @@ class Import extends AbstractModel */ private $messageManager; - /** - * @Deprecated Property isn't used - * @var Random - */ - private $random; - /** * @var Upload */ @@ -221,7 +215,6 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager - * @param Random|null $random * @param Upload|null $upload * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -242,7 +235,6 @@ public function __construct( DateTime $localeDate, array $data = [], ManagerInterface $messageManager = null, - Random $random = null, Upload $upload = null ) { $this->_importExportData = $importExportData; @@ -260,8 +252,6 @@ public function __construct( $this->localeDate = $localeDate; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); - $this->random = $random ?: ObjectManager::getInstance() - ->get(Random::class); $this->upload = $upload ?: ObjectManager::getInstance() ->get(Upload::class); parent::__construct($logger, $filesystem, $data); diff --git a/app/code/Magento/ImportExport/Model/Import/Adapter.php b/app/code/Magento/ImportExport/Model/Import/Adapter.php index 3aa5abbc21216..638e34fffe026 100644 --- a/app/code/Magento/ImportExport/Model/Import/Adapter.php +++ b/app/code/Magento/ImportExport/Model/Import/Adapter.php @@ -74,6 +74,6 @@ public static function findAdapterFor($source, $directory, $options = null) */ public static function findAdapterForData($source, $options = null) { - return self::factory('Data', null, $source, $options); + return self::factory('Base64EncodedCsvData', null, $source, $options); } } diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Data.php b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php similarity index 96% rename from app/code/Magento/ImportExport/Model/Import/Source/Data.php rename to app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php index 141ba1caeb3e7..e78a02ac31f7d 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Data.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php @@ -9,7 +9,7 @@ use Magento\ImportExport\Model\Import\AbstractSource; -class Data extends AbstractSource +class Base64EncodedCsvData extends AbstractSource { /** * @var array From 601ccea4b55c4db6bf1ff3b73cff13980d6ae533 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 19 Jul 2022 14:10:28 -0500 Subject: [PATCH 44/57] ACPT-493: Upload csv with request parameter --- .../Magento/ImportCsv/Model/StartImport.php | 13 +++- .../Magento/ImportExport/Model/Import.php | 44 +++++-------- .../ImportExport/Model/Import/Adapter.php | 17 +---- .../Import/Source/Base64EncodedCsvData.php | 7 +- .../ImportExport/Model/Import/Source/Csv.php | 8 +-- .../Model/Import/Source/Factory.php | 64 +++++++++++++++++++ .../ImportExport/Model/Import/Source/Zip.php | 10 +-- .../Test/Unit/Helper/ReportTest.php | 3 +- .../Test/Unit/Model/ImportTest.php | 3 +- 9 files changed, 112 insertions(+), 57 deletions(-) create mode 100644 app/code/Magento/ImportExport/Model/Import/Source/Factory.php diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php index 8811bac37bd7b..8072d9cb35602 100644 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ b/app/code/Magento/ImportCsv/Model/StartImport.php @@ -10,6 +10,7 @@ use Magento\ImportCsvApi\Api\Data\SourceDataInterface; use Magento\ImportCsvApi\Api\StartImportInterface; use Magento\ImportExport\Model\Import; +use Magento\ImportExport\Model\Import\Source\Factory as SourceFactory; /** * @inheritdoc @@ -22,13 +23,21 @@ class StartImport implements StartImportInterface */ private $import; + /** + * @var SourceFactory + */ + private $sourceFactory; + /** * @param Import $import + * @param SourceFactory $sourceFactory */ public function __construct( - Import $import + Import $import, + SourceFactory $sourceFactory ) { $this->import = $import; + $this->sourceFactory = $sourceFactory; } /** @@ -41,7 +50,7 @@ public function execute( $import = $this->import->setData($source); $errors = []; try { - $source = $import->getSourceForApiData(); + $source = $this->sourceFactory->create($import->getData('csvData')); $this->processValidationResult($import->validateSource($source), $errors); } catch (\Magento\Framework\Exception\LocalizedException $e) { $errors[] = $e->getMessage(); diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 22e01e366f7cd..ba7cd008ad12b 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -17,7 +17,6 @@ use Magento\Framework\Filesystem; use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerRegistry; -use Magento\Framework\Math\Random; use Magento\Framework\Message\ManagerInterface; use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\ImportExport\Helper\Data as DataHelper; @@ -30,6 +29,7 @@ use Magento\ImportExport\Model\Import\Entity\Factory; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; +use Magento\ImportExport\Model\Import\Source\Factory as SourceFactory; use Magento\ImportExport\Model\ResourceModel\Import\Data; use Magento\ImportExport\Model\Source\Import\AbstractBehavior; use Magento\ImportExport\Model\Source\Import\Behavior\Factory as BehaviorFactory; @@ -193,6 +193,11 @@ class Import extends AbstractModel */ private $messageManager; + /** + * @var SourceFactory + */ + private $sourceFactory; + /** * @var Upload */ @@ -215,6 +220,7 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager + * @param SourceFactory $sourceFactory * @param Upload|null $upload * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -235,6 +241,7 @@ public function __construct( DateTime $localeDate, array $data = [], ManagerInterface $messageManager = null, + SourceFactory $sourceFactory = null, Upload $upload = null ) { $this->_importExportData = $importExportData; @@ -252,6 +259,8 @@ public function __construct( $this->localeDate = $localeDate; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); + $this->sourceFactory = $sourceFactory?? ObjectManager::getInstance() + ->get(SourceFactory::class); $this->upload = $upload ?: ObjectManager::getInstance() ->get(Upload::class); parent::__construct($logger, $filesystem, $data); @@ -304,7 +313,8 @@ protected function _getEntityAdapter() /** * Returns source adapter object. - * + * @Deprecated + * @see \Magento\ImportExport\Model\Import\Source\Factory::create() * @param string $sourceFile Full path to source file * @return AbstractSource * @throws FileSystemException @@ -318,20 +328,6 @@ protected function _getSourceAdapter($sourceFile) ); } - /** - * Returns source adapter object for Api Data. - * - * @return AbstractSource - */ - protected function _getSourceAdapterForApi() - { - return Adapter::findAdapterForData( - // phpcs:ignore Magento2.Functions.DiscouragedFunction - trim(base64_decode($this->getData('csvData'))), - $this->getData(self::FIELD_FIELD_SEPARATOR) - ); - } - /** * Return operation result messages * @@ -588,7 +584,11 @@ public function uploadFileAndGetSource() { $sourceFile = $this->uploadSource(); try { - $source = $this->_getSourceAdapter($sourceFile); + $source = $this->sourceFactory->create( + $sourceFile, + $this->_filesystem->getDirectoryWrite(DirectoryList::ROOT), + $this->getData(self::FIELD_FIELD_SEPARATOR) + ); } catch (\Exception $e) { $this->_varDirectory->delete($this->_varDirectory->getRelativePath($sourceFile)); throw new LocalizedException(__($e->getMessage())); @@ -597,16 +597,6 @@ public function uploadFileAndGetSource() return $source; } - /** - * Get Source adapter object - * - * @return AbstractSource - */ - public function getSourceForApiData() - { - return $this->_getSourceAdapterForApi(); - } - /** * Get Var Directory instance * diff --git a/app/code/Magento/ImportExport/Model/Import/Adapter.php b/app/code/Magento/ImportExport/Model/Import/Adapter.php index 638e34fffe026..15fd0525cc78f 100644 --- a/app/code/Magento/ImportExport/Model/Import/Adapter.php +++ b/app/code/Magento/ImportExport/Model/Import/Adapter.php @@ -6,10 +6,12 @@ namespace Magento\ImportExport\Model\Import; use Magento\Framework\Filesystem\Directory\Write; +use Magento\ImportExport\Model\Import\Source\Factory; /** * Import adapter model - * + * @Deprecated + * @see \Magento\ImportExport\Model\Import\Source\Factory * @author Magento Core Team */ class Adapter @@ -63,17 +65,4 @@ public static function findAdapterFor($source, $directory, $options = null) { return self::factory(pathinfo($source, PATHINFO_EXTENSION), $directory, $source, $options); // phpcs:ignore } - - /** - * Create adapter instance for specified source. - * - * @param string $source Source - * @param mixed $options OPTIONAL Adapter constructor options - * phpcs:disable Magento2.Functions.StaticFunction - * @return AbstractSource - */ - public static function findAdapterForData($source, $options = null) - { - return self::factory('Base64EncodedCsvData', null, $source, $options); - } } diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php index e78a02ac31f7d..2123cc52b872f 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php @@ -31,11 +31,12 @@ class Base64EncodedCsvData extends AbstractSource /** * Read Data and detect column names * - * @param string $data + * @param string $source */ - public function __construct(string $data) + public function __construct(string $source) { - $rowsData = preg_split("/\r\n|\n|\r/", $data); + $source = trim(base64_decode($source)); + $rowsData = preg_split("/\r\n|\n|\r/", $source); $colNames = explode(',', $rowsData[0]); $this->rows = array_splice($rowsData, 1); parent::__construct($colNames); diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Csv.php b/app/code/Magento/ImportExport/Model/Import/Source/Csv.php index e04ef9f9537bf..4383733abc0b5 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Csv.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Csv.php @@ -42,14 +42,14 @@ class Csv extends \Magento\ImportExport\Model\Import\AbstractSource * * There must be column names in the first line * - * @param string $file + * @param string $source * @param Read $directory * @param string $delimiter * @param string $enclosure * @throws \LogicException */ public function __construct( - $file, + $source, Read $directory, $delimiter = ',', $enclosure = '"' @@ -57,12 +57,12 @@ public function __construct( // phpcs:ignore Magento2.Functions.DiscouragedFunction register_shutdown_function([$this, 'destruct']); try { - $this->filePath = $directory->getRelativePath($file); + $this->filePath = $directory->getRelativePath($source); $this->_file = $directory->openFile($this->filePath, 'r'); $this->_file->seek(0); self::$openFiles[$this->filePath] = true; } catch (\Magento\Framework\Exception\FileSystemException $e) { - throw new \LogicException("Unable to open file: '{$file}'"); + throw new \LogicException("Unable to open file: '{$source}'"); } if ($delimiter) { $this->_delimiter = $delimiter; diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Factory.php b/app/code/Magento/ImportExport/Model/Import/Source/Factory.php new file mode 100644 index 0000000000000..f61d2c232dd10 --- /dev/null +++ b/app/code/Magento/ImportExport/Model/Import/Source/Factory.php @@ -0,0 +1,64 @@ +objectManager = $objectManager; + } + + /** + * @param $source + * @param $directory + * @param $options + * @return AbstractSource + * @throws \Magento\Framework\Exception\LocalizedException + */ + public function create($source, $directory = null, $options = null): AbstractSource + { + $adapterClass = 'Magento\ImportExport\Model\Import\Source\\'; + if (file_exists($source)) { + $type = ucfirst(strtolower(pathinfo($source, PATHINFO_EXTENSION))); + } else { + $type = 'Base64EncodedCsvData'; + } + if (!is_string($source) || !$source) { + throw new \Magento\Framework\Exception\LocalizedException( + __('The source type must be a non-empty string.') + ); + } + $adapterClass.= $type; + if (!class_exists($adapterClass)) { + throw new \Magento\Framework\Exception\LocalizedException( + __('\'%1\' file extension is not supported', $type) + ); + } + return $this->objectManager->create( + $adapterClass, + [ + 'source' => $source, + 'directory' => $directory, + 'options' => $options + ] + ); + } +} diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Zip.php b/app/code/Magento/ImportExport/Model/Import/Source/Zip.php index 75f29edd0d515..e34760cd63a13 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Zip.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Zip.php @@ -14,7 +14,7 @@ class Zip extends Csv { /** - * @param string $file + * @param string $source * @param \Magento\Framework\Filesystem\Directory\Write $directory * @param string $options * @param \Magento\Framework\Archive\Zip|null $zipArchive @@ -22,20 +22,20 @@ class Zip extends Csv * @throws \Magento\Framework\Exception\ValidatorException */ public function __construct( - $file, + $source, \Magento\Framework\Filesystem\Directory\Write $directory, $options, \Magento\Framework\Archive\Zip $zipArchive = null ) { $zip = $zipArchive ?? ObjectManager::getInstance()->get(\Magento\Framework\Archive\Zip::class); $csvFile = $zip->unpack( - $file, - preg_replace('/\.zip$/i', '.csv', $file) + $source, + preg_replace('/\.zip$/i', '.csv', $source) ); if (!$csvFile) { throw new ValidatorException(__('Sorry, but the data is invalid or the file is not uploaded.')); } - $directory->delete($directory->getRelativePath($file)); + $directory->delete($directory->getRelativePath($source)); try { parent::__construct($csvFile, $directory, $options); diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index 2f10ce42f84d4..373a68720e62f 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -204,6 +204,7 @@ public function testGetSummaryStats() $importHistoryModel = $this->createMock(History::class); $localeDate = $this->createMock(\Magento\Framework\Stdlib\DateTime\DateTime::class); $upload = $this->createMock(Upload::class); + $sourceFactoryMock = $this->createMock(\Magento\ImportExport\Model\Import\Source\Factory::class); $import = new Import( $logger, $filesystem, @@ -221,7 +222,7 @@ public function testGetSummaryStats() $localeDate, [], null, - null, + $sourceFactoryMock, $upload ); $import->setData('entity', 'catalog_product'); diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php index 3f5b40cef7982..f25c268be3d1f 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php @@ -231,6 +231,7 @@ protected function setUp(): void ->expects($this->any()) ->method('getDriver') ->willReturn($this->_driver); + $sourceFactoryMock = $this->createMock(\Magento\ImportExport\Model\Import\Source\Factory::class); $this->upload = $this->createMock(Upload::class); $this->import = $this->getMockBuilder(Import::class) ->setConstructorArgs( @@ -251,7 +252,7 @@ protected function setUp(): void $this->dateTime, [], null, - null, + $sourceFactoryMock, $this->upload ] ) From dd77f7ee50be8e287b3575d6800107d05fd2d2e4 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 19 Jul 2022 15:45:20 -0500 Subject: [PATCH 45/57] ACPT-493: Upload csv with request parameter --- app/code/Magento/ImportExport/Model/Import.php | 13 ++----------- .../Model/Import/Source/Base64EncodedCsvData.php | 1 + .../ImportExport/Test/Unit/Helper/ReportTest.php | 2 -- .../ImportExport/Test/Unit/Model/ImportTest.php | 2 -- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index ba7cd008ad12b..2d46d589f097f 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -220,7 +220,6 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager - * @param SourceFactory $sourceFactory * @param Upload|null $upload * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -241,7 +240,6 @@ public function __construct( DateTime $localeDate, array $data = [], ManagerInterface $messageManager = null, - SourceFactory $sourceFactory = null, Upload $upload = null ) { $this->_importExportData = $importExportData; @@ -259,8 +257,6 @@ public function __construct( $this->localeDate = $localeDate; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); - $this->sourceFactory = $sourceFactory?? ObjectManager::getInstance() - ->get(SourceFactory::class); $this->upload = $upload ?: ObjectManager::getInstance() ->get(Upload::class); parent::__construct($logger, $filesystem, $data); @@ -313,8 +309,7 @@ protected function _getEntityAdapter() /** * Returns source adapter object. - * @Deprecated - * @see \Magento\ImportExport\Model\Import\Source\Factory::create() + * * @param string $sourceFile Full path to source file * @return AbstractSource * @throws FileSystemException @@ -584,11 +579,7 @@ public function uploadFileAndGetSource() { $sourceFile = $this->uploadSource(); try { - $source = $this->sourceFactory->create( - $sourceFile, - $this->_filesystem->getDirectoryWrite(DirectoryList::ROOT), - $this->getData(self::FIELD_FIELD_SEPARATOR) - ); + $source = $this->_getSourceAdapter($sourceFile); } catch (\Exception $e) { $this->_varDirectory->delete($this->_varDirectory->getRelativePath($sourceFile)); throw new LocalizedException(__($e->getMessage())); diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php index 2123cc52b872f..80378bb48cf1e 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php @@ -35,6 +35,7 @@ class Base64EncodedCsvData extends AbstractSource */ public function __construct(string $source) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction $source = trim(base64_decode($source)); $rowsData = preg_split("/\r\n|\n|\r/", $source); $colNames = explode(',', $rowsData[0]); diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index 373a68720e62f..5d821aa64d9e8 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -204,7 +204,6 @@ public function testGetSummaryStats() $importHistoryModel = $this->createMock(History::class); $localeDate = $this->createMock(\Magento\Framework\Stdlib\DateTime\DateTime::class); $upload = $this->createMock(Upload::class); - $sourceFactoryMock = $this->createMock(\Magento\ImportExport\Model\Import\Source\Factory::class); $import = new Import( $logger, $filesystem, @@ -222,7 +221,6 @@ public function testGetSummaryStats() $localeDate, [], null, - $sourceFactoryMock, $upload ); $import->setData('entity', 'catalog_product'); diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php index f25c268be3d1f..ad80c3c08fc38 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php @@ -231,7 +231,6 @@ protected function setUp(): void ->expects($this->any()) ->method('getDriver') ->willReturn($this->_driver); - $sourceFactoryMock = $this->createMock(\Magento\ImportExport\Model\Import\Source\Factory::class); $this->upload = $this->createMock(Upload::class); $this->import = $this->getMockBuilder(Import::class) ->setConstructorArgs( @@ -252,7 +251,6 @@ protected function setUp(): void $this->dateTime, [], null, - $sourceFactoryMock, $this->upload ] ) From 0c0c86d5af8117d0a644093968b2ce9b9ad8a896 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 19 Jul 2022 17:09:11 -0500 Subject: [PATCH 46/57] ACPT-493: Upload csv with request parameter --- app/code/Magento/ImportExport/Model/Import.php | 13 +++++++++++-- .../Model/Import/Source/Base64EncodedCsvData.php | 6 +++--- .../ImportExport/Model/Import/Source/Csv.php | 8 ++++---- .../ImportExport/Model/Import/Source/Factory.php | 2 +- .../ImportExport/Model/Import/Source/Zip.php | 10 +++++----- .../ImportExport/Test/Unit/Helper/ReportTest.php | 2 ++ .../ImportExport/Test/Unit/Model/ImportTest.php | 2 ++ 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 2d46d589f097f..55976e2781e42 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -220,6 +220,7 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager + * @param SourceFactory|null $sourceFactory * @param Upload|null $upload * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -240,6 +241,7 @@ public function __construct( DateTime $localeDate, array $data = [], ManagerInterface $messageManager = null, + SourceFactory $sourceFactory = null, Upload $upload = null ) { $this->_importExportData = $importExportData; @@ -257,6 +259,8 @@ public function __construct( $this->localeDate = $localeDate; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); + $this->sourceFactory = $sourceFactory?? ObjectManager::getInstance() + ->get(SourceFactory::class); $this->upload = $upload ?: ObjectManager::getInstance() ->get(Upload::class); parent::__construct($logger, $filesystem, $data); @@ -309,7 +313,8 @@ protected function _getEntityAdapter() /** * Returns source adapter object. - * + * @Deprecated + * @see \Magento\ImportExport\Model\Import\Source\Factory::create() * @param string $sourceFile Full path to source file * @return AbstractSource * @throws FileSystemException @@ -579,7 +584,11 @@ public function uploadFileAndGetSource() { $sourceFile = $this->uploadSource(); try { - $source = $this->_getSourceAdapter($sourceFile); + $source = $this->sourceFactory->create( + $sourceFile, + $this->_filesystem->getDirectoryWrite(DirectoryList::ROOT), + $this->getData(self::FIELD_FIELD_SEPARATOR) + ); } catch (\Exception $e) { $this->_varDirectory->delete($this->_varDirectory->getRelativePath($sourceFile)); throw new LocalizedException(__($e->getMessage())); diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php index 80378bb48cf1e..1522734a96b6f 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php @@ -31,12 +31,12 @@ class Base64EncodedCsvData extends AbstractSource /** * Read Data and detect column names * - * @param string $source + * @param string $file */ - public function __construct(string $source) + public function __construct(string $file) { // phpcs:ignore Magento2.Functions.DiscouragedFunction - $source = trim(base64_decode($source)); + $source = trim(base64_decode($file)); $rowsData = preg_split("/\r\n|\n|\r/", $source); $colNames = explode(',', $rowsData[0]); $this->rows = array_splice($rowsData, 1); diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Csv.php b/app/code/Magento/ImportExport/Model/Import/Source/Csv.php index 4383733abc0b5..e04ef9f9537bf 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Csv.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Csv.php @@ -42,14 +42,14 @@ class Csv extends \Magento\ImportExport\Model\Import\AbstractSource * * There must be column names in the first line * - * @param string $source + * @param string $file * @param Read $directory * @param string $delimiter * @param string $enclosure * @throws \LogicException */ public function __construct( - $source, + $file, Read $directory, $delimiter = ',', $enclosure = '"' @@ -57,12 +57,12 @@ public function __construct( // phpcs:ignore Magento2.Functions.DiscouragedFunction register_shutdown_function([$this, 'destruct']); try { - $this->filePath = $directory->getRelativePath($source); + $this->filePath = $directory->getRelativePath($file); $this->_file = $directory->openFile($this->filePath, 'r'); $this->_file->seek(0); self::$openFiles[$this->filePath] = true; } catch (\Magento\Framework\Exception\FileSystemException $e) { - throw new \LogicException("Unable to open file: '{$source}'"); + throw new \LogicException("Unable to open file: '{$file}'"); } if ($delimiter) { $this->_delimiter = $delimiter; diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Factory.php b/app/code/Magento/ImportExport/Model/Import/Source/Factory.php index f61d2c232dd10..e9e31609e13d4 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Factory.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Factory.php @@ -55,7 +55,7 @@ public function create($source, $directory = null, $options = null): AbstractSou return $this->objectManager->create( $adapterClass, [ - 'source' => $source, + 'file' => $source, 'directory' => $directory, 'options' => $options ] diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Zip.php b/app/code/Magento/ImportExport/Model/Import/Source/Zip.php index e34760cd63a13..75f29edd0d515 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Zip.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Zip.php @@ -14,7 +14,7 @@ class Zip extends Csv { /** - * @param string $source + * @param string $file * @param \Magento\Framework\Filesystem\Directory\Write $directory * @param string $options * @param \Magento\Framework\Archive\Zip|null $zipArchive @@ -22,20 +22,20 @@ class Zip extends Csv * @throws \Magento\Framework\Exception\ValidatorException */ public function __construct( - $source, + $file, \Magento\Framework\Filesystem\Directory\Write $directory, $options, \Magento\Framework\Archive\Zip $zipArchive = null ) { $zip = $zipArchive ?? ObjectManager::getInstance()->get(\Magento\Framework\Archive\Zip::class); $csvFile = $zip->unpack( - $source, - preg_replace('/\.zip$/i', '.csv', $source) + $file, + preg_replace('/\.zip$/i', '.csv', $file) ); if (!$csvFile) { throw new ValidatorException(__('Sorry, but the data is invalid or the file is not uploaded.')); } - $directory->delete($directory->getRelativePath($source)); + $directory->delete($directory->getRelativePath($file)); try { parent::__construct($csvFile, $directory, $options); diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index 5d821aa64d9e8..373a68720e62f 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -204,6 +204,7 @@ public function testGetSummaryStats() $importHistoryModel = $this->createMock(History::class); $localeDate = $this->createMock(\Magento\Framework\Stdlib\DateTime\DateTime::class); $upload = $this->createMock(Upload::class); + $sourceFactoryMock = $this->createMock(\Magento\ImportExport\Model\Import\Source\Factory::class); $import = new Import( $logger, $filesystem, @@ -221,6 +222,7 @@ public function testGetSummaryStats() $localeDate, [], null, + $sourceFactoryMock, $upload ); $import->setData('entity', 'catalog_product'); diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php index ad80c3c08fc38..f25c268be3d1f 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php @@ -231,6 +231,7 @@ protected function setUp(): void ->expects($this->any()) ->method('getDriver') ->willReturn($this->_driver); + $sourceFactoryMock = $this->createMock(\Magento\ImportExport\Model\Import\Source\Factory::class); $this->upload = $this->createMock(Upload::class); $this->import = $this->getMockBuilder(Import::class) ->setConstructorArgs( @@ -251,6 +252,7 @@ protected function setUp(): void $this->dateTime, [], null, + $sourceFactoryMock, $this->upload ] ) From 751f5cfe92f421b0946c972368cbf9a665125603 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 19 Jul 2022 18:50:16 -0500 Subject: [PATCH 47/57] ACPT-493: Upload csv with request parameter --- app/code/Magento/ImportExport/Model/Import.php | 16 ++-------------- .../ImportExport/Model/Import/Source/Factory.php | 15 +++++++++++---- .../ImportExport/Test/Unit/Helper/ReportTest.php | 2 -- .../ImportExport/Test/Unit/Model/ImportTest.php | 2 -- 4 files changed, 13 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 55976e2781e42..b262af25a4105 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -193,11 +193,6 @@ class Import extends AbstractModel */ private $messageManager; - /** - * @var SourceFactory - */ - private $sourceFactory; - /** * @var Upload */ @@ -220,7 +215,6 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager - * @param SourceFactory|null $sourceFactory * @param Upload|null $upload * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -241,7 +235,6 @@ public function __construct( DateTime $localeDate, array $data = [], ManagerInterface $messageManager = null, - SourceFactory $sourceFactory = null, Upload $upload = null ) { $this->_importExportData = $importExportData; @@ -259,8 +252,6 @@ public function __construct( $this->localeDate = $localeDate; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); - $this->sourceFactory = $sourceFactory?? ObjectManager::getInstance() - ->get(SourceFactory::class); $this->upload = $upload ?: ObjectManager::getInstance() ->get(Upload::class); parent::__construct($logger, $filesystem, $data); @@ -313,6 +304,7 @@ protected function _getEntityAdapter() /** * Returns source adapter object. + * * @Deprecated * @see \Magento\ImportExport\Model\Import\Source\Factory::create() * @param string $sourceFile Full path to source file @@ -584,11 +576,7 @@ public function uploadFileAndGetSource() { $sourceFile = $this->uploadSource(); try { - $source = $this->sourceFactory->create( - $sourceFile, - $this->_filesystem->getDirectoryWrite(DirectoryList::ROOT), - $this->getData(self::FIELD_FIELD_SEPARATOR) - ); + $source = $this->_getSourceAdapter($sourceFile); } catch (\Exception $e) { $this->_varDirectory->delete($this->_varDirectory->getRelativePath($sourceFile)); throw new LocalizedException(__($e->getMessage())); diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Factory.php b/app/code/Magento/ImportExport/Model/Import/Source/Factory.php index e9e31609e13d4..3ea7534cafd9d 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Factory.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Factory.php @@ -8,18 +8,22 @@ namespace Magento\ImportExport\Model\Import\Source; +use Magento\Framework\Filesystem\Directory\Write; use Magento\Framework\ObjectManagerInterface; use Magento\ImportExport\Model\Import\AbstractSource; class Factory { /** - * Object Manager + * Object Manager Instance * * @var \Magento\Framework\ObjectManagerInterface */ private $objectManager; + /** + * @param ObjectManagerInterface $objectManager + */ public function __construct( ObjectManagerInterface $objectManager ) { @@ -27,10 +31,13 @@ public function __construct( } /** - * @param $source - * @param $directory - * @param $options + * Create class instance with specified parameters + * + * @param string $source + * @param Write $directory + * @param mixed $options * @return AbstractSource + * @phpcs:disable Magento2.Functions.DiscouragedFunction * @throws \Magento\Framework\Exception\LocalizedException */ public function create($source, $directory = null, $options = null): AbstractSource diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index 373a68720e62f..5d821aa64d9e8 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -204,7 +204,6 @@ public function testGetSummaryStats() $importHistoryModel = $this->createMock(History::class); $localeDate = $this->createMock(\Magento\Framework\Stdlib\DateTime\DateTime::class); $upload = $this->createMock(Upload::class); - $sourceFactoryMock = $this->createMock(\Magento\ImportExport\Model\Import\Source\Factory::class); $import = new Import( $logger, $filesystem, @@ -222,7 +221,6 @@ public function testGetSummaryStats() $localeDate, [], null, - $sourceFactoryMock, $upload ); $import->setData('entity', 'catalog_product'); diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php index f25c268be3d1f..ad80c3c08fc38 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php @@ -231,7 +231,6 @@ protected function setUp(): void ->expects($this->any()) ->method('getDriver') ->willReturn($this->_driver); - $sourceFactoryMock = $this->createMock(\Magento\ImportExport\Model\Import\Source\Factory::class); $this->upload = $this->createMock(Upload::class); $this->import = $this->getMockBuilder(Import::class) ->setConstructorArgs( @@ -252,7 +251,6 @@ protected function setUp(): void $this->dateTime, [], null, - $sourceFactoryMock, $this->upload ] ) From 091a1dc13e48f6e4b7af43305ee65b82f121e44d Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 19 Jul 2022 21:38:12 -0500 Subject: [PATCH 48/57] ACPT-493: Upload csv with request parameter --- app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php index ad80c3c08fc38..d4464b02eac39 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php @@ -568,7 +568,6 @@ public function testInvalidateIndex() $this->dateTime, [], null, - null, $this->upload ); @@ -605,7 +604,6 @@ public function testInvalidateIndexWithoutIndexers() $this->dateTime, [], null, - null, $this->upload ); @@ -639,7 +637,6 @@ public function testGetKnownEntity() $this->dateTime, [], null, - null, $this->upload ); @@ -679,7 +676,6 @@ public function testGetUnknownEntity($entity) $this->dateTime, [], null, - null, $this->upload ); From 3a9f05034d3bad69f575db2e43e19e2e7118e787 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 20 Jul 2022 00:25:22 -0500 Subject: [PATCH 49/57] ACPT-493: Upload csv with request parameter --- app/code/Magento/ImportExport/Model/Import.php | 16 ++++++++++++++-- .../ImportExport/Model/Import/Source/Factory.php | 14 +++++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index b262af25a4105..55976e2781e42 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -193,6 +193,11 @@ class Import extends AbstractModel */ private $messageManager; + /** + * @var SourceFactory + */ + private $sourceFactory; + /** * @var Upload */ @@ -215,6 +220,7 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager + * @param SourceFactory|null $sourceFactory * @param Upload|null $upload * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -235,6 +241,7 @@ public function __construct( DateTime $localeDate, array $data = [], ManagerInterface $messageManager = null, + SourceFactory $sourceFactory = null, Upload $upload = null ) { $this->_importExportData = $importExportData; @@ -252,6 +259,8 @@ public function __construct( $this->localeDate = $localeDate; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); + $this->sourceFactory = $sourceFactory?? ObjectManager::getInstance() + ->get(SourceFactory::class); $this->upload = $upload ?: ObjectManager::getInstance() ->get(Upload::class); parent::__construct($logger, $filesystem, $data); @@ -304,7 +313,6 @@ protected function _getEntityAdapter() /** * Returns source adapter object. - * * @Deprecated * @see \Magento\ImportExport\Model\Import\Source\Factory::create() * @param string $sourceFile Full path to source file @@ -576,7 +584,11 @@ public function uploadFileAndGetSource() { $sourceFile = $this->uploadSource(); try { - $source = $this->_getSourceAdapter($sourceFile); + $source = $this->sourceFactory->create( + $sourceFile, + $this->_filesystem->getDirectoryWrite(DirectoryList::ROOT), + $this->getData(self::FIELD_FIELD_SEPARATOR) + ); } catch (\Exception $e) { $this->_varDirectory->delete($this->_varDirectory->getRelativePath($sourceFile)); throw new LocalizedException(__($e->getMessage())); diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Factory.php b/app/code/Magento/ImportExport/Model/Import/Source/Factory.php index 3ea7534cafd9d..f241f6710b179 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Factory.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Factory.php @@ -59,13 +59,17 @@ public function create($source, $directory = null, $options = null): AbstractSou __('\'%1\' file extension is not supported', $type) ); } + $data = []; + $data['file'] = $source; + $data['directory'] = $directory; + if ($type === 'Csv') { + $data['delimiter'] = $options; + } else { + $data['options'] = $options; + } return $this->objectManager->create( $adapterClass, - [ - 'file' => $source, - 'directory' => $directory, - 'options' => $options - ] + $data ); } } From 4e6cc2d50c6510ae677ae7442bfea8210d9d3d8d Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 20 Jul 2022 07:57:44 -0500 Subject: [PATCH 50/57] ACPT-493: Upload csv with request parameter --- app/code/Magento/ImportExport/Model/Import.php | 16 ++-------------- .../ImportExport/Model/Import/Source/Factory.php | 14 +++++--------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 55976e2781e42..b262af25a4105 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -193,11 +193,6 @@ class Import extends AbstractModel */ private $messageManager; - /** - * @var SourceFactory - */ - private $sourceFactory; - /** * @var Upload */ @@ -220,7 +215,6 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager - * @param SourceFactory|null $sourceFactory * @param Upload|null $upload * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -241,7 +235,6 @@ public function __construct( DateTime $localeDate, array $data = [], ManagerInterface $messageManager = null, - SourceFactory $sourceFactory = null, Upload $upload = null ) { $this->_importExportData = $importExportData; @@ -259,8 +252,6 @@ public function __construct( $this->localeDate = $localeDate; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); - $this->sourceFactory = $sourceFactory?? ObjectManager::getInstance() - ->get(SourceFactory::class); $this->upload = $upload ?: ObjectManager::getInstance() ->get(Upload::class); parent::__construct($logger, $filesystem, $data); @@ -313,6 +304,7 @@ protected function _getEntityAdapter() /** * Returns source adapter object. + * * @Deprecated * @see \Magento\ImportExport\Model\Import\Source\Factory::create() * @param string $sourceFile Full path to source file @@ -584,11 +576,7 @@ public function uploadFileAndGetSource() { $sourceFile = $this->uploadSource(); try { - $source = $this->sourceFactory->create( - $sourceFile, - $this->_filesystem->getDirectoryWrite(DirectoryList::ROOT), - $this->getData(self::FIELD_FIELD_SEPARATOR) - ); + $source = $this->_getSourceAdapter($sourceFile); } catch (\Exception $e) { $this->_varDirectory->delete($this->_varDirectory->getRelativePath($sourceFile)); throw new LocalizedException(__($e->getMessage())); diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Factory.php b/app/code/Magento/ImportExport/Model/Import/Source/Factory.php index f241f6710b179..3ea7534cafd9d 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Factory.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Factory.php @@ -59,17 +59,13 @@ public function create($source, $directory = null, $options = null): AbstractSou __('\'%1\' file extension is not supported', $type) ); } - $data = []; - $data['file'] = $source; - $data['directory'] = $directory; - if ($type === 'Csv') { - $data['delimiter'] = $options; - } else { - $data['options'] = $options; - } return $this->objectManager->create( $adapterClass, - $data + [ + 'file' => $source, + 'directory' => $directory, + 'options' => $options + ] ); } } From ce1b57c460ced696c5f6e394e6e4618bacecfa92 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 25 Jul 2022 13:32:49 -0500 Subject: [PATCH 51/57] ACPT-493: Upload csv with request parameter --- .../Magento/ImportExport/Model/Import.php | 34 +++++++------------ .../Import/Source/Base64EncodedCsvData.php | 6 ++-- .../ImportExport/Model/Source/Upload.php | 22 ++++++------ .../Test/Unit/Helper/ReportTest.php | 1 + .../Test/Unit/Model/ImportTest.php | 5 +++ .../MediaStorage/Model/File/Uploader.php | 25 ++++++++------ 6 files changed, 46 insertions(+), 47 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index b262af25a4105..40e06387c51b8 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -17,6 +17,7 @@ use Magento\Framework\Filesystem; use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Indexer\IndexerRegistry; +use Magento\Framework\Math\Random; use Magento\Framework\Message\ManagerInterface; use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\ImportExport\Helper\Data as DataHelper; @@ -29,7 +30,6 @@ use Magento\ImportExport\Model\Import\Entity\Factory; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; -use Magento\ImportExport\Model\Import\Source\Factory as SourceFactory; use Magento\ImportExport\Model\ResourceModel\Import\Data; use Magento\ImportExport\Model\Source\Import\AbstractBehavior; use Magento\ImportExport\Model\Source\Import\Behavior\Factory as BehaviorFactory; @@ -193,6 +193,12 @@ class Import extends AbstractModel */ private $messageManager; + /** + * @Deprecated Property isn't used + * @var Random + */ + private $random; + /** * @var Upload */ @@ -215,6 +221,7 @@ class Import extends AbstractModel * @param DateTime $localeDate * @param array $data * @param ManagerInterface|null $messageManager + * @param Random|null $random * @param Upload|null $upload * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -235,6 +242,7 @@ public function __construct( DateTime $localeDate, array $data = [], ManagerInterface $messageManager = null, + Random $random = null, Upload $upload = null ) { $this->_importExportData = $importExportData; @@ -252,6 +260,8 @@ public function __construct( $this->localeDate = $localeDate; $this->messageManager = $messageManager ?: ObjectManager::getInstance() ->get(ManagerInterface::class); + $this->random = $random ?: ObjectManager::getInstance() + ->get(Random::class); $this->upload = $upload ?: ObjectManager::getInstance() ->get(Upload::class); parent::__construct($logger, $filesystem, $data); @@ -559,7 +569,7 @@ public function uploadSource() // phpcs:ignore Magento2.Functions.DiscouragedFunction $extension = pathinfo($result['file'], PATHINFO_EXTENSION); $sourceFile = $this->getWorkingDir() . $entity . '.' . $extension; - $sourceFileRelative = $this->getVarDirectory()->getRelativePath($sourceFile); + $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); $this->_removeBom($sourceFile); $this->createHistoryReport($sourceFileRelative, $entity, $extension, $result); return $sourceFile; @@ -585,16 +595,6 @@ public function uploadFileAndGetSource() return $source; } - /** - * Get Var Directory instance - * - * @return Filesystem\Directory\WriteInterface - */ - public function getVarDirectory() - { - return $this->_varDirectory; - } - /** * Remove BOM from a file * @@ -848,14 +848,4 @@ public function getDeletedItemsCount() { return $this->_getEntityAdapter()->getDeletedItemsCount(); } - - /** - * Get Upload Instance - * - * @return Upload - */ - public function getUpload() - { - return $this->upload; - } } diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php index 1522734a96b6f..ec7ebae8c81fb 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php @@ -19,14 +19,14 @@ class Base64EncodedCsvData extends AbstractSource /** * @var string */ - protected $_delimiter = ','; + private $delimiter = ','; /** * Field Enclosure character * * @var string */ - protected $_enclosure = ''; + private $enclosure = ''; /** * Read Data and detect column names @@ -38,7 +38,7 @@ public function __construct(string $file) // phpcs:ignore Magento2.Functions.DiscouragedFunction $source = trim(base64_decode($file)); $rowsData = preg_split("/\r\n|\n|\r/", $source); - $colNames = explode(',', $rowsData[0]); + $colNames = explode($this->delimiter, $rowsData[0]); $this->rows = array_splice($rowsData, 1); parent::__construct($colNames); } diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index 3ca7281c6636f..0e9817208134f 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -23,17 +23,17 @@ class Upload /** * @var FileTransferFactory */ - protected $_httpFactory; + private $httpFactory; /** * @var DataHelper */ - protected $_importExportData = null; + private $importExportData = null; /** * @var UploaderFactory */ - protected $_uploaderFactory; + private $uploaderFactory; /** * @var Random @@ -59,11 +59,11 @@ public function __construct( Random $random, Filesystem $filesystem ) { - $this->_httpFactory = $httpFactory; - $this->_importExportData = $importExportData; - $this->_uploaderFactory = $uploaderFactory; + $this->httpFactory = $httpFactory; + $this->importExportData = $importExportData; + $this->uploaderFactory = $uploaderFactory; $this->random = $random; - $this->_varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); + $this->varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); } /** * Move uploaded file. @@ -75,11 +75,11 @@ public function __construct( public function uploadSource(string $entity) { /** @var $adapter \Zend_File_Transfer_Adapter_Http */ - $adapter = $this->_httpFactory->create(); + $adapter = $this->httpFactory->create(); if (!$adapter->isValid(Import::FIELD_NAME_SOURCE_FILE)) { $errors = $adapter->getErrors(); if ($errors[0] == \Zend_Validate_File_Upload::INI_SIZE) { - $errorMessage = $this->_importExportData->getMaxUploadSizeMessage(); + $errorMessage = $this->importExportData->getMaxUploadSizeMessage(); } else { $errorMessage = __('The file was not uploaded.'); } @@ -87,12 +87,12 @@ public function uploadSource(string $entity) } /** @var $uploader Uploader */ - $uploader = $this->_uploaderFactory->create(['fileId' => Import::FIELD_NAME_SOURCE_FILE]); + $uploader = $this->uploaderFactory->create(['fileId' => Import::FIELD_NAME_SOURCE_FILE]); $uploader->setAllowedExtensions(['csv', 'zip']); $uploader->skipDbProcessing(true); $fileName = $this->random->getRandomString(32) . '.' . $uploader->getFileExtension(); try { - $result = $uploader->save($this->_varDirectory->getAbsolutePath('importexport/'), $fileName); + $result = $uploader->save($this->varDirectory->getAbsolutePath('importexport/'), $fileName); } catch (\Exception $e) { throw new LocalizedException(__('The file cannot be uploaded.')); } diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php index 5d821aa64d9e8..2f10ce42f84d4 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/ReportTest.php @@ -221,6 +221,7 @@ public function testGetSummaryStats() $localeDate, [], null, + null, $upload ); $import->setData('entity', 'catalog_product'); diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php index d4464b02eac39..3f5b40cef7982 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php @@ -251,6 +251,7 @@ protected function setUp(): void $this->dateTime, [], null, + null, $this->upload ] ) @@ -568,6 +569,7 @@ public function testInvalidateIndex() $this->dateTime, [], null, + null, $this->upload ); @@ -604,6 +606,7 @@ public function testInvalidateIndexWithoutIndexers() $this->dateTime, [], null, + null, $this->upload ); @@ -637,6 +640,7 @@ public function testGetKnownEntity() $this->dateTime, [], null, + null, $this->upload ); @@ -676,6 +680,7 @@ public function testGetUnknownEntity($entity) $this->dateTime, [], null, + null, $this->upload ); diff --git a/app/code/Magento/MediaStorage/Model/File/Uploader.php b/app/code/Magento/MediaStorage/Model/File/Uploader.php index c6e1f09c4b029..31fd9554139b1 100644 --- a/app/code/Magento/MediaStorage/Model/File/Uploader.php +++ b/app/code/Magento/MediaStorage/Model/File/Uploader.php @@ -10,6 +10,7 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Filesystem; use Magento\Framework\Validation\ValidationException; use Magento\MediaStorage\Model\File\Validator\Image; @@ -55,26 +56,28 @@ class Uploader extends \Magento\Framework\File\Uploader /** * @var \Magento\Framework\Filesystem\Directory\WriteInterface */ - protected $_varDirectory; + private $varDirectory; /** * @param string $fileId * @param \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\MediaStorage\Helper\File\Storage $coreFileStorage * @param \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator - * @param \Magento\Framework\Filesystem $filesystem + * @param \Magento\Framework\Filesystem|null $filesystem */ public function __construct( $fileId, \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDb, \Magento\MediaStorage\Helper\File\Storage $coreFileStorage, \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $validator, - \Magento\Framework\Filesystem $filesystem + \Magento\Framework\Filesystem $filesystem = null ) { $this->_coreFileStorageDb = $coreFileStorageDb; $this->_coreFileStorage = $coreFileStorage; $this->_validator = $validator; - $this->_varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); + $filesystem = $filesystem ?: ObjectManager::getInstance() + ->get(\Magento\Framework\Filesystem::class); + $this->varDirectory = $filesystem->getDirectoryWrite(DirectoryList::VAR_IMPORT_EXPORT); parent::__construct($fileId); } @@ -169,22 +172,22 @@ public function renameFile(string $entity) } if (!$extension) { - $this->_varDirectory->delete($uploadedFile); + $this->varDirectory->delete($uploadedFile); throw new LocalizedException(__('The file you uploaded has no extension.')); } - $sourceFile = $this->_varDirectory->getAbsolutePath('importexport/') . $entity; + $sourceFile = $this->varDirectory->getAbsolutePath('importexport/') . $entity; $sourceFile .= '.' . $extension; - $sourceFileRelative = $this->_varDirectory->getRelativePath($sourceFile); + $sourceFileRelative = $this->varDirectory->getRelativePath($sourceFile); if (strtolower($uploadedFile) != strtolower($sourceFile)) { - if ($this->_varDirectory->isExist($sourceFileRelative)) { - $this->_varDirectory->delete($sourceFileRelative); + if ($this->varDirectory->isExist($sourceFileRelative)) { + $this->varDirectory->delete($sourceFileRelative); } try { - $this->_varDirectory->renameFile( - $this->_varDirectory->getRelativePath($uploadedFile), + $this->varDirectory->renameFile( + $this->varDirectory->getRelativePath($uploadedFile), $sourceFileRelative ); } catch (FileSystemException $e) { From 3afe76a940084d95955e8b5de339a2b8b49ea900 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 25 Jul 2022 14:46:11 -0500 Subject: [PATCH 52/57] ACPT-493: Upload csv with request parameter --- .../Model/Import/Source/Base64EncodedCsvData.php | 9 +-------- app/code/Magento/ImportExport/Model/Source/Upload.php | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php index ec7ebae8c81fb..0215de4580ba6 100644 --- a/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php +++ b/app/code/Magento/ImportExport/Model/Import/Source/Base64EncodedCsvData.php @@ -21,13 +21,6 @@ class Base64EncodedCsvData extends AbstractSource */ private $delimiter = ','; - /** - * Field Enclosure character - * - * @var string - */ - private $enclosure = ''; - /** * Read Data and detect column names * @@ -48,7 +41,7 @@ public function __construct(string $file) * * @return array */ - protected function _getNextRow() + public function _getNextRow() { if ($this->_key===count($this->rows)) { return []; diff --git a/app/code/Magento/ImportExport/Model/Source/Upload.php b/app/code/Magento/ImportExport/Model/Source/Upload.php index 0e9817208134f..fdddaaf1a4abe 100644 --- a/app/code/Magento/ImportExport/Model/Source/Upload.php +++ b/app/code/Magento/ImportExport/Model/Source/Upload.php @@ -43,7 +43,7 @@ class Upload /** * @var WriteInterface */ - protected $_varDirectory; + private $varDirectory; /** * @param FileTransferFactory $httpFactory From 4299950b06c50af85a4a06567de4f3371bb823ad Mon Sep 17 00:00:00 2001 From: slopukhov Date: Tue, 26 Jul 2022 11:33:00 -0500 Subject: [PATCH 53/57] ACPT-97: Create new Jmeter scenario for new Import REST api endpoint --- setup/performance-toolkit/benchmark.jmx | 182 ++++++++++++++++++++++-- 1 file changed, 174 insertions(+), 8 deletions(-) diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx index a0301de048210..ab506bbd0a987 100644 --- a/setup/performance-toolkit/benchmark.jmx +++ b/setup/performance-toolkit/benchmark.jmx @@ -269,6 +269,11 @@ ${__P(apiBasePercentage,0)} = + + apiImportProductsPercentage + ${__P(apiImportProductsPercentage,0)} + = + apiOrderInvoiceShipmentSync ${__P(apiOrderInvoiceShipmentSync,0)} @@ -61806,7 +61811,7 @@ if (totalCount == null) { attribute_code_1 - $.data.products.filters[1].request_var + $.data.products.aggregations[1].attribute_code BODY @@ -61814,7 +61819,7 @@ if (totalCount == null) { attribute_value_1 - $.data.products.filters[1].filter_items[0].value_string + $.data.products.aggregations[1].options[0].value BODY @@ -61822,7 +61827,7 @@ if (totalCount == null) { attribute_code_2 - $.data.products.filters[2].request_var + $.data.products.aggregations[2].attribute_code BODY @@ -61830,7 +61835,7 @@ if (totalCount == null) { attribute_value_2 - $.data.products.filters[2].filter_items[0].value_string + $.data.products.aggregations[2].options[0].value BODY @@ -62072,7 +62077,7 @@ if (totalCount == null) { attribute_code_1 - $.data.products.filters[1].request_var + $.data.products.aggregations[1].attribute_code BODY @@ -62080,7 +62085,7 @@ if (totalCount == null) { attribute_value_1 - $.data.products.filters[1].filter_items[0].value_string + $.data.products.aggregations[1].options[0].value BODY @@ -62088,7 +62093,7 @@ if (totalCount == null) { attribute_code_2 - $.data.products.filters[2].request_var + $.data.products.aggregations[2].attribute_code BODY @@ -62096,7 +62101,7 @@ if (totalCount == null) { attribute_value_2 - $.data.products.filters[2].filter_items[0].value_string + $.data.products.aggregations[2].options[0].value BODY @@ -110806,6 +110811,7 @@ vars.put("adminImportFilePath", filepath); File is valid! To start import process + Checked rows: 1000, checked entities: 1000 Assertion.response_data false @@ -111328,6 +111334,7 @@ vars.put("adminImportFilePath", filepath); File is valid! To start import process + Checked rows: 1000, checked entities: 1000 Assertion.response_data false @@ -111471,6 +111478,165 @@ vars.put("adminImportFilePath", filepath); + + 1 + false + 1 + ${apiImportProductsPercentage} + tool/fragments/_system/scenario_controller_tmpl.jmx + + + +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 = "" + } + + + + javascript + tool/fragments/_system/setup_label.jmx + + + + vars.put("testLabel", "API Import Products"); + + true + + + + + + + Content-Type + application/json + + + Accept + */* + + + tool/fragments/ce/api/header_manager_before_token.jmx + + + + true + + + + false + {"username":"${admin_user}","password":"${admin_password}"} + = + + + + + + 60000 + 200000 + ${request_protocol} + + ${base_path}rest/V1/integration/admin/token + POST + true + false + true + false + false + + tool/fragments/ce/api/admin_token_retrieval.jmx + + + admin_token + $ + + + BODY + + + + + ^.{10,}$ + + Assertion.response_data + false + 1 + variable + admin_token + + + + + + + + Authorization + Bearer ${admin_token} + + + tool/fragments/ce/api/header_manager.jmx + + + + groovy + + + true + def fileAsBase64 = new File("${files_folder}${adminImportProductFilePath}").bytes.encodeBase64().toString() +vars.put("importProductsFileToBase64", fileAsBase64) + tool/fragments/ce/api/import_products_file_to_base64.jmx + + + + true + + + + false + {"source":{"entity":"catalog_product", "behavior":"append","validationStrategy": "validation-stop-on-errors", "allowedErrorCount":"10","csvData":"${importProductsFileToBase64}"}} + = + + + + + + 60000 + 200000 + ${request_protocol} + + ${base_path}/rest/default/V1/import/csv + POST + true + false + true + false + false + + tool/fragments/ce/api/import_products.jmx + + + + + Entities Processed\: 1000\"\] + + Assertion.response_data + false + 2 + + + + + + 1 false From 5c26d170ec601feb22cfe83df8ce019652aa5562 Mon Sep 17 00:00:00 2001 From: slopukhov Date: Tue, 26 Jul 2022 16:50:21 -0500 Subject: [PATCH 54/57] ACPT-97: Create new Jmeter scenario for new Import REST api endpoint --- setup/performance-toolkit/benchmark.jmx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx index ab506bbd0a987..fc1c77b936424 100644 --- a/setup/performance-toolkit/benchmark.jmx +++ b/setup/performance-toolkit/benchmark.jmx @@ -61811,7 +61811,7 @@ if (totalCount == null) { attribute_code_1 - $.data.products.aggregations[1].attribute_code + $.data.products.filters[1].request_var BODY @@ -61819,7 +61819,7 @@ if (totalCount == null) { attribute_value_1 - $.data.products.aggregations[1].options[0].value + $.data.products.filters[1].filter_items[0].value_string BODY @@ -61827,7 +61827,7 @@ if (totalCount == null) { attribute_code_2 - $.data.products.aggregations[2].attribute_code + $.data.products.filters[2].request_var BODY @@ -61835,7 +61835,7 @@ if (totalCount == null) { attribute_value_2 - $.data.products.aggregations[2].options[0].value + $.data.products.filters[2].filter_items[0].value_string BODY @@ -62077,7 +62077,7 @@ if (totalCount == null) { attribute_code_1 - $.data.products.aggregations[1].attribute_code + $.data.products.filters[1].request_var BODY @@ -62085,7 +62085,7 @@ if (totalCount == null) { attribute_value_1 - $.data.products.aggregations[1].options[0].value + $.data.products.filters[1].filter_items[0].value_string BODY @@ -62093,7 +62093,7 @@ if (totalCount == null) { attribute_code_2 - $.data.products.aggregations[2].attribute_code + $.data.products.filters[2].request_var BODY @@ -62101,7 +62101,7 @@ if (totalCount == null) { attribute_value_2 - $.data.products.aggregations[2].options[0].value + $.data.products.filters[2].filter_items[0].value_string BODY From 6728063f7422b3308d5317cb5eda6b11b1f0681c Mon Sep 17 00:00:00 2001 From: slopukhov Date: Mon, 1 Aug 2022 09:24:34 -0500 Subject: [PATCH 55/57] ACPT-668: Remove benchmark.jmx and benchmark_2015.jmx from magento-commerce/magento2* repos --- setup/performance-toolkit/README.md | 353 +- setup/performance-toolkit/benchmark.jmx | 118682 ---------------- setup/performance-toolkit/benchmark_2015.jmx | 6905 - 3 files changed, 1 insertion(+), 125939 deletions(-) delete mode 100644 setup/performance-toolkit/benchmark.jmx delete mode 100644 setup/performance-toolkit/benchmark_2015.jmx diff --git a/setup/performance-toolkit/README.md b/setup/performance-toolkit/README.md index 108872555a40d..5daace537614a 100644 --- a/setup/performance-toolkit/README.md +++ b/setup/performance-toolkit/README.md @@ -1,354 +1,3 @@ # Performance Toolkit -The Performance Toolkit enables you to test the performance of your Magento installations and the impact of your customizations. It allows you to generate sample data for testing performance and to run Apache JMeter scenarios, which imitate users activity. As a result, you get a set of metrics, that you can use to judge how changes affect performance, and the overall load capacity of your server(s). - -## Installation - -### Apache JMeter - -- Go to the [Download Apache JMeter](http://jmeter.apache.org/download_jmeter.cgi) page and download JMeter in the *Binaries* section. Note that Java 8 or later is required. -- Unzip the archive. - -### JSON Plugins - -- Go to the [JMeter Installing Plugins](https://jmeter-plugins.org/install/Install/) page. -- Download `plugins-manager.jar` and put it into the `{JMeter path}/lib/ext` directory. Then restart JMeter. -- Follow the instructions provided on the [JMeter Plugins Manager](https://jmeter-plugins.org/wiki/PluginsManager/) page to open Plugins Manager. -- Select *Json Plugins* from the plugins listed on the *Available Plugins* tab, then click the *Apply changes and restart JMeter* button. - -## Quick Start - -Before running the JMeter tests for the first time, you will need to first use the `php bin/magento setup:performance:generate-fixtures {profile path}` command to generate the test data. -You can find the configuration files of available B2C profiles in the folders `setup/performance-toolkit/profiles/ce` and `setup/performance-toolkit/profiles/ee`. - -It can take a significant amount of time to generate a profile. For example, generating the large profile can take up to 4 hours. So we recommend using the `-s` option to skip indexation. Then you can start indexation manually. - -Splitting generation and indexation processes doesn't reduce total processing time, but it requires fewer resources. For example, to generate a small profile, use commands: - - php bin/magento setup:performance:generate-fixtures -s setup/performance-toolkit/profiles/ce/small.xml - php bin/magento indexer:reindex - -For more information about the available profiles and generating fixtures generation, read [Generate data for performance testing](https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-perf-data.html). - -For run Admin Pool in multithreading mode, please be sure, that: - -- "Admin Account Sharing" is enabled - - `Follow Stores > Configuration > Advanced > Admin > Security. - Set Admin Account Sharing to Yes.` - -- Indexers setup in "Update by schedule" mode: - - `Follow System > Tool > Index Management - Set "Update by schedule" for all idexers` - -**Note:** Before generating medium or large profiles, it may be necessary to increase the value of `tmp_table_size` and `max_heap_table_size` parameters for MySQL to 512Mb or more. The value of `memory_limit` for PHP should be 1Gb or more. - -There are two JMeter scenarios located in `setup/performance-toolkit` folder: `benchmark.jmx` and `benchmark_2015.jmx` (legacy version). - -**Note:** To be sure that all quotes are empty, run the following MySQL query before each run of a scenario: - - UPDATE quote SET is_active = 0 WHERE is_active = 1; - -### Run JMeter scenario via console - -The following parameters can be passed to the `benchmark.jmx` scenario: - -Main parameters: - -| Parameter Name | Default Value | Description | -| --------------------------------------------- | ------------------- | ---------------------------------------------------------------------------------------- | -| host | localhost | URL component 'host' of application being tested (URL or IP). | -| base_path | / | Base path for tested site. | -| files_folder | ./files/ | Path to various files that are used in scenario (`setup/performance-toolkit/files`). | -| request_protocol | http | Hypertext Transfer Protocol (http or https). | -| graphql_port_number | | Port number for GraphQL. | -| admin_password | 123123q | Admin backend password. | -| admin_path | admin | Admin backend path. | -| admin_user | admin | Admin backend user. | -| cache_hits_percentage | 100 | Cache hits percentage. | -| seedForRandom | 1 | System option for setting random number method | -| loops | 1 | Number of loops to run. | -| frontendPoolUsers | 0 | Total number of Frontend threads. | -| adminPoolUsers | 0 | Total number of Admin threads. | -| csrPoolUsers | 0 | Total number of CSR threads. | -| apiPoolUsers | 0 | Total number of API threads. | -| oneThreadScenariosPoolUsers | 0 | Total number of One Thread Scenarios threads. | -| graphQLPoolUsers | 0 | Total number of GraphQL threads. | -| combinedBenchmarkPoolUsers | 0 | Total number of Combined Benchmark threads. | - -Parameters for Frontend pool: - -| Parameter Name | Default Value | Description | -| --------------------------------------------- | ------------------- | ----------------------------------------------------------------------------------------- | -| browseCatalogByCustomerPercentage | 0 | Percentage of threads in Frontend Pool that emulate customer catalog browsing activities. | -| browseCatalogByGuestPercentage | 0 | Percentage of threads in Frontend Pool that emulate guest catalog browsing activities. | -| siteSearchPercentage | 0 | Percentage of threads in Frontend Pool that emulate catalog search activities. | -| addToCartByGuestPercentage | 0 | Percentage of threads in Frontend Pool that emulate abandoned cart activities by guest. | -| addToWishlistPercentage | 0 | Percentage of threads in Frontend Pool that emulate adding products to Wishlist. | -| compareProductsPercentage | 0 | Percentage of threads in Frontend Pool that emulate products comparison. | -| checkoutByGuestPercentage | 0 | Percentage of threads in Frontend Pool that emulate checkout by guest. | -| checkoutByCustomerPercentage | 0 | Percentage of threads in Frontend Pool that emulate checkout by customer. | -| reviewByCustomerPercentage | 0 | Percentage of threads in Frontend Pool that emulate reviewing products. | -| addToCartByCustomerPercentage | 0 | Percentage of threads in Frontend Pool that emulate abandoned cart activities by customer.| -| accountManagementPercentage | 0 | Percentage of threads in Frontend Pool that emulate account management. | - -Parameters for Admin pool: - -| Parameter Name | Default Value | Description | -| --------------------------------------------- | ------------------- | ----------------------------------------------------------------------------------------- | -| adminCMSManagementPercentage | 0 | Percentage of threads in Admin Pool that emulate CMS management activities. | -| browseProductGridPercentage | 0 | Percentage of threads in Admin Pool that emulate products grid browsing activities. | -| browseOrderGridPercentage | 0 | Percentage of threads in Admin Pool that emulate orders grid browsing activities. | -| adminProductCreationPercentage | 0 | Percentage of threads in Admin Pool that emulate product creation activities. | -| adminProductEditingPercentage | 0 | Percentage of threads in Admin Pool that emulate product editing activities. | - -Parameters for CSR pool: - -| Parameter Name | Default Value | Description | -| --------------------------------------------- | ------------------- | ----------------------------------------------------------------------------------------- | -| adminReturnsManagementPercentage | 0 | Percentage of threads in CSR Pool that emulate admin returns management activities. | -| browseCustomerGridPercentage | 0 | Percentage of threads in CSR Pool that emulate customers grid browsing activities. | -| adminCreateOrderPercentage | 0 | Percentage of threads in CSR Pool that emulate creating orders activities. | - -Parameters for API pool: - -| Parameter Name | Default Value | Description | -| --------------------------------------------- | ------------------- | ----------------------------------------------------------------------------------------- | -| apiBasePercentage | 0 | Percentage of threads in API Pool that emulate API requests activities. | - -Parameters for One Thread Scenarios pool: - -| Parameter Name | Default Value | Description | -| --------------------------------------------- | ------------------- | ----------------------------------------------------------------------------- | -| productGridMassActionPercentage | 0 | Percentage of threads that emulate product mass action activities. | -| importProductsPercentage | 0 | Percentage of threads that emulate products import activities. | -| importCustomersPercentage | 0 | Percentage of threads that emulate customers import activities. | -| exportProductsPercentage | 0 | Percentage of threads that emulate products export activities. | -| exportCustomersPercentage | 0 | Percentage of threads that emulate customers export activities. | -| apiSinglePercentage | 0 | Percentage of threads that emulate API nonparallel requests activities. | -| adminCategoryManagementPercentage | 0 | Percentage of threads that emulate category management activities. | -| adminPromotionRulesPercentage | 0 | Percentage of threads that emulate promotion rules activities. | -| adminCustomerManagementPercentage | 0 | Percentage of threads that emulate customer management activities. | -| adminEditOrderPercentage | 0 | Percentage of threads that emulate edit order activities. | -| catalogGraphQLPercentage | 0 | Percentage of threads that emulate nonparallel catalogGraphQL activities. | - -Parameters for GraphQL pool: - -| Parameter Name | Default Value | Description | -| ----------------------------------------------------------------- | ------------------- | ----------------------------------------------------------------------------------------- | -| graphqlGetListOfProductsByCategoryIdPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlGetSimpleProductDetailsByProductUrlKeyPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlGetSimpleProductDetailsByNamePercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlGetConfigurableProductDetailsByProductUrlKeyPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlGetConfigurableProductDetailsByNamePercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlGetProductSearchByTextAndCategoryIdPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlGetCategoryListByCategoryIdPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlUrlInfoByUrlKeyPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlGetCmsPageByIdPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlGetNavigationMenuByCategoryIdPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlCreateEmptyCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlGetEmptyCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlSetShippingAddressOnCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlSetBillingAddressOnCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlAddSimpleProductToCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlAddConfigurableProductToCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlUpdateSimpleProductQtyInCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlUpdateConfigurableProductQtyInCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlRemoveSimpleProductFromCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlRemoveConfigurableProductFromCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlApplyCouponToCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlRemoveCouponFromCartPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlCatalogBrowsingByGuestPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | -| graphqlCheckoutByGuestPercentage | 0 | Percentage of threads in GraphQL Pool that emulate GraphQL requests activities. | - -Parameters for Combined Benchmark pool: - -| Parameter Name | Default Value | Description | -| ----------------------------------------------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------- | -| cBrowseCatalogByGuestPercentage | 29 | Percentage of threads in Combined Benchmark Pool that emulate customer catalog browsing activities. | -| cSiteSearchPercentage | 29 | Percentage of threads in Combined Benchmark Pool that emulate catalog search activities. | -| cAddToCartByGuestPercentage | 26 | Percentage of threads in Combined Benchmark Pool that emulate abandoned cart activities. | -| cAddToWishlistPercentage | 1.5 | Percentage of threads in Combined Benchmark Pool that emulate adding products to Wishlist. | -| cCompareProductsPercentage | 1.5 | Percentage of threads in Combined Benchmark Pool that emulate products comparison. | -| cCheckoutByGuestPercentage | 3.5 | Percentage of threads in Combined Benchmark Pool that emulate checkout by guest. | -| cCheckoutByCustomerPercentage | 3.5 | Percentage of threads in Combined Benchmark Pool that emulate checkout by customer. | -| cAccountManagementPercentage | 1 | Percentage of threads in Combined Benchmark Pool that emulate account management. | -| cAdminCMSManagementPercentage | 0.35 | Percentage of threads in Combined Benchmark Pool that emulate CMS management activities. | -| cAdminBrowseProductGridPercentage | 0.2 | Percentage of threads in Combined Benchmark Pool that emulate products grid browsing activities. | -| cAdminBrowseOrderGridPercentage | 0.2 | Percentage of threads in Combined Benchmark Pool that emulate orders grid browsing activities. | -| cAdminProductCreationPercentage | 0.5 | Percentage of threads in Combined Benchmark Pool that emulate product creation activities. | -| cAdminProductEditingPercentage | 0.65 | Percentage of threads in Combined Benchmark Pool that emulate product editing activities. | -| cAdminReturnsManagementPercentage | 0.75 | Percentage of threads in Combined Benchmark Pool that emulate admin returns management activities. | -| cAdminBrowseCustomerGridPercentage | 0.1 | Percentage of threads in Combined Benchmark Pool that emulate customers grid browsing activities. | -| cAdminCreateOrderPercentage | 0.5 | Percentage of threads in Combined Benchmark Pool that emulate creating orders activities. | -| cAdminCategoryManagementPercentage | 0.15 | Percentage of threads in Combined Benchmark Pool that emulate admin category management activities. | -| cAdminPromotionRulesPercentage | 0.2 | Percentage of threads in Combined Benchmark Pool that emulate admin promotion rules activities. | -| cAdminCustomerManagementPercentage | 0.4 | Percentage of threads in Combined Benchmark Pool that emulate admin customers management activities. | -| cAdminEditOrderPercentage | 1 | Percentage of threads in Combined Benchmark Pool that emulate admin edit order activities. | - -Parameters must be passed to the command line with the `J` prefix: - -`-J{parameter_name}={parameter_value}` - -The required parameters are `{host}` and `{base_path}`. All other parameters are optional. If you do not pass any custom value, a default value will be used. - -There are some options that you should pass to JMeter in the console mode: - -`-n` Run scenario in Non-GUI mode -`-t` Path to the JMX file to be run -`-l` Path to the JTL file to log sample results to -`-j` Path to JMeter run log file - -To get more details about available JMeter options, read [Non-GUI Mode](http://jmeter.apache.org/usermanual/get-started.html#non_gui). - -For example, you can run the B2C scenario via console with: -90 threads for the Frontend Pool where: - -- 80% - guest catalog browsing activities. -- 20% - checkout by customer. - -10 threads for the Admin Pool where: - -- 10% - admin products grid browsing activities. -- 90% - admin product creation activities. - - cd {JMeter path}/bin/ - jmeter -n -t {path to performance toolkit}/benchmark.jmx -j ./jmeter.log -l ./jmeter-results.jtl -Jhost=magento2.dev -Jbase_path=/ -Jadmin_path=admin -JfrontendPoolUsers=90 -JadminPoolUsers=10 -JbrowseCatalogByGuestPercentage=80 -JcheckoutByCustomerPercentage=20 -JbrowseProductGridPercentage=10 -JadminProductCreationPercentage=90 - -As a result, you will get `jmeter.log` and `jmeter-results.jtl`. The`jmeter.log` contains information about the test run and can be helpful in determining the cause of an error. The JTL file is a text file containing the results of a test run. It can be opened in the GUI mode to perform analysis of the results (see the *Output* section below). - -The following parameters can be passed to the `benchmark_2015.jmx` scenario: - -| Parameter Name | Default Value | Description | -| -------------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| host | localhost | URL component 'host' of application being tested (URL or IP). | -| base_path | / | Base path for tested site. | -| report_save_path | ./ | Path where reports will be saved. Reports will be saved in current working directory by default. | -| ramp_period | 300 | Ramp period (seconds). Period the request will be distributed within. | -| orders | 0 | Number of orders in the period specified in the current allocation. If `orders` is specified, the `users` parameter will be recalculated. | -| users | 100 | Number of concurrent users. Recommended amount is 100. Minimal amount is 10. | -| view_product_add_to_cart_percent | 62 | Percentage of users that will only reach the add to cart stage. | -| view_catalog_percent | 30 | Percentage of users that will only reach the view catalog stage. | -| guest_checkout_percent | 4 | Percentage of users that will reach the guest checkout stage. | -| customer_checkout_percent | 4 | Percentage of users that will reach the (logged-in) customer checkout stage. | -| loops | 1 | Number of loops to run. | -| admin_path | admin | Admin backend path. | -| admin_user | admin | Admin backend user. | -| admin_password | 123123q | Admin backend password. | -| think_time_deviation | 1000 | Deviation (ms) for "think time" emulation. | -| think_time_delay_offset | 2000 | Constant delay offset (ms) for "think time" emulation. | - -### Run JMeter scenario via GUI - -**Note:** Use the GUI mode only for scenario debugging and viewing reports. Use console mode for real-life load testing, because it requires significantly fewer resources. - -- Change directories to `{JMeter path}/bin/` and run `jmeter.bat`. -- Click *File -> Open (Ctrl+O)* and select `benchmark.jmx` file or drag and drop the `benchmark.jmx` file in the opened GUI. - -In the root node (*Performance Test Plan*) in the left panel, you can change *User Defined Variables* listed in the previous section. -To run a script, click the *Start* button (green arrow in the top menu). - -## Output - -The results of running a JMeter scenario are available in the *View Results Tree* and *Aggregate Report* nodes in the left panel of the JMeter GUI. - -When the script is run via GUI, the results are available in the left panel. Choose the corresponding report. When the script is run via console, a JTL report is generated. You can run JMeter GUI later and open it in the corresponding report node. - -The legacy scenario (Benchmark_2015) contains *View Results Tree*, *Detailed URLs Report* and *Summary Report* nodes. - -### View Results Tree - -This report shows the tree of all requests and responses made during the scenario run. It provides information about the response time, headers and response codes. This report is useful for scenario debugging, but should be disabled during load testing because it consumes a lot of resources. - -You can open a JTL file in this report to debug a scenario and view the requests that cause errors. By default, a JTL file doesn't contain bodies of requests/responses, so it is better to debug scenarios in the GUI mode. - -For more details, read [View Results Tree](http://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree). - -### Aggregate Report - -This report contains aggregated information about all requests. It provides request count, min, max, average, error rate, approximate throughput, etc. You can open a JTL file in this report to analyze the results of a scenario run. - -For more details, read [Aggregate Report](http://jmeter.apache.org/usermanual/component_reference.html#Aggregate_Report). - -### Detailed URLs Report (Legacy) - -This report contains information about URLs. Note that the URL is displayed only in a generated report file (URL is not displayed in the GUI). The report file name is `{report_save_path}/detailed-urls-report.log`. It can be opened as a CSV file. - -For more details, read [View Results in Table](http://jmeter.apache.org/usermanual/component_reference.html#View_Results_in_Table). - -### Summary Report (Legacy) - -The report contains aggregated information about threads. The report file name is `{report_save_path}/summary-report.log`. - -For more details, read [Summary Report](http://jmeter.apache.org/usermanual/component_reference.html#Summary_Report). - -## Additional Information - -### Scenarios - -`benchmark.jmx` scenario has the following pools: - -- **Frontend Pool** (frontendPoolUsers) - -- **Admin Pool** (adminPoolUsers) - -- **CSR Pool** (csrPoolUsers) - -- **API Pool** (apiPoolUsers) - -- **One Thread Scenarios Pool** (oneThreadScenariosPoolUsers) - -- **GraphQL Pool** (graphQLPoolUsers) - -- **Combined Benchmark Pool** (combinedBenchmarkPoolUsers) - -- **Legacy Threads** - -- **Legacy Scenario** - -#### Legacy Threads - -The `benchmark_2015.jmx` script consists of five thread groups: the setup thread and four user threads. -By default, the percentage ratio between the thread groups is as follows: - -- Browsing, adding items to the cart and abandon cart (BrowsAddToCart suffix in reports) - 62% -- Just browsing (CatProdBrows suffix in reports) - 30% -- Browsing, adding items to cart and checkout as guest (GuestChkt suffix in reports) - 4% -- Browsing, adding items to cart and checkout as registered customer (CustomerChkt suffix in reports) - 4% - -The `benchmark_2015.jmx` script consists of five thread groups: the setup thread and four user threads. -By default, the percentage ratio between the thread groups is as follows: - -- Browsing, adding items to the cart and abandon cart (BrowsAddToCart suffix in reports) - 62% -- Just browsing (CatProdBrows suffix in reports) - 30% -- Browsing, adding items to cart and checkout as guest (GuestChkt suffix in reports) - 4% -- Browsing, adding items to cart and checkout as registered customer (CustomerChkt suffix in reports) - 4% - -#### Legacy Scenario - -It is convenient to use *Summary Report* for the results analysis. To evaluate the number of each request per hour, use the value in the *Throughput* column. - -To get the summary value of throughput for some action: - -1. Find all rows that relate to the desired action -2. Convert values from *Throughput* column to a common denominator -3. Sum up the obtained values - -For example, to get summary throughput for the *Simple Product View* action when the following rows are present in the *Summary Report*: - -| Label | # Samples | ... | Throughput | -| ------------------------------------- | --------------- | --- | ---------- | -| ... | ... | ... | ... | -| Open Home Page(CatProdBrows) | 64 | ... | 2.2/sec | -| Simple Product 1 View(GuestChkt) | 4 | ... | 1.1/sec | -| Simple Product 2 View(BrowsAddToCart) | 30 | ... | 55.6/min | -| ... | ... | ... | ... | - -Find all rows with the label *Simple Product # View* and calculate the summary throughput: - - 1.1/sec + 55.6/min = 66/min + 55.6/min = 121.6/min = 2.02/sec - -If you need information about the summary throughput of the *Checkout* actions, find the rows with labels *Checkout success* and make the same calculation. - -For the total number of page views, you will want to sum up all actions minus the setup thread. +For information about the available profiles and generating fixtures generation, read [Generate data for performance testing](https://devdocs.magento.com/guides/v2.4/config-guide/cli/config-cli-subcommands-perf-data.html). diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx deleted file mode 100644 index fc1c77b936424..0000000000000 --- a/setup/performance-toolkit/benchmark.jmx +++ /dev/null @@ -1,118682 +0,0 @@ - - - - - - - false - false - - - - - host - ${__P(host,localhost)} - = - - - base_path - ${__P(base_path,/)} - = - - - files_folder - ${__P(files_folder,./files/)} - = - - - request_protocol - ${__P(request_protocol,http)} - = - - - graphql_port_number - ${__P(graphql_port_number,)} - = - - - admin_password - ${__P(admin_password,)} - = - - - admin_path - ${__P(admin_path,admin)} - = - - - admin_user - ${__P(admin_user,admin)} - = - - - cache_hits_percentage - ${__P(cache_hits_percentage,100)} - = - - - seedForRandom - ${__P(seedForRandom,1)} - = - - - loops - ${__P(loops,1)} - = - - - frontendPoolUsers - ${__P(frontendPoolUsers,0)} - = - - - adminPoolUsers - ${__P(adminPoolUsers,0)} - = - - - csrPoolUsers - ${__P(csrPoolUsers,0)} - = - - - apiPoolUsers - ${__P(apiPoolUsers,0)} - = - - - oneThreadScenariosPoolUsers - ${__P(oneThreadScenariosPoolUsers,0)} - = - - - graphQLPoolUsers - ${__P(graphQLPoolUsers,0)} - = - - - combinedBenchmarkPoolUsers - ${__P(combinedBenchmarkPoolUsers,0)} - = - - - restAPIcombinedBenchmarkPoolUsers - ${__P(restAPIcombinedBenchmarkPoolUsers,0)} - = - - - graphQLcombinedBenchmarkPoolUsers - ${__P(graphQLcombinedBenchmarkPoolUsers,0)} - = - - - accountManagementPercentage - ${__P(accountManagementPercentage,0)} - = - - - addToCartByCustomerPercentage - ${__P(addToCartByCustomerPercentage,0)} - = - - - addToCartByGuestPercentage - ${__P(addToCartByGuestPercentage,0)} - = - - - addToWishlistPercentage - ${__P(addToWishlistPercentage,0)} - = - - - adminCMSManagementDelay - ${__P(adminCMSManagementDelay,0)} - = - - - adminCMSManagementPercentage - ${__P(adminCMSManagementPercentage,0)} - = - - - adminCategoryCount - ${__P(adminCategoryCount,0)} - = - - - adminCategoryManagementDelay - ${__P(adminCategoryManagementDelay,0)} - = - - - adminCategoryManagementPercentage - ${__P(adminCategoryManagementPercentage,0)} - = - - - adminCreateOrderPercentage - ${__P(adminCreateOrderPercentage,0)} - = - - - adminCreateProcessReturns - ${__P(adminCreateProcessReturns,0)} - = - - - adminCreateProcessReturnsDelay - ${__P(adminCreateProcessReturnsDelay,0)} - = - - - adminCustomerManagementDelay - ${__P(adminCustomerManagementDelay,0)} - = - - - adminCustomerManagementPercentage - ${__P(adminCustomerManagementPercentage,0)} - = - - - adminEditOrderPercentage - ${__P(adminEditOrderPercentage,0)} - = - - - adminImportCustomerBehavior - ${__P(adminImportCustomerBehavior,append)} - = - - - adminImportCustomerFilePath - ${__P(adminImportCustomerFilePath,import_customers/customer_import_addupdate.csv)} - = - - - adminImportProductBehavior - ${__P(adminImportProductBehavior,append)} - = - - - adminImportProductFilePath - ${__P(adminImportProductFilePath,import_products/product_import_append_1.csv)} - = - - - adminProductCreationPercentage - ${__P(adminProductCreationPercentage,0)} - = - - - adminProductEditingPercentage - ${__P(adminProductEditingPercentage,0)} - = - - - adminPromotionRulesPercentage - ${__P(adminPromotionRulesPercentage,0)} - = - - - adminPromotionsManagement - ${__P(adminPromotionsManagement,0)} - = - - - adminPromotionsManagementDelay - ${__P(adminPromotionsManagementDelay,0)} - = - - - adminReturnsManagementPercentage - ${__P(adminReturnsManagementPercentage,0)} - = - - - admin_browse_customer_filter_text - ${__P(admin_browse_customer_filter_text,Firstname)} - = - - - admin_browse_orders_filter_text - ${__P(admin_browse_orders_filter_text,pending)} - = - - - admin_browse_product_filter_text - ${__P(admin_browse_product_filter_text,Product)} - = - - - admin_token - ${__P(admin_token,admin_token)} - = - - - admin_users_distribution_per_admin_pool - ${__P(admin_users_distribution_per_admin_pool,1)} - = - - - apiBasePercentage - ${__P(apiBasePercentage,0)} - = - - - apiImportProductsPercentage - ${__P(apiImportProductsPercentage,0)} - = - - - apiOrderInvoiceShipmentSync - ${__P(apiOrderInvoiceShipmentSync,0)} - = - - - apiProcessOrders - ${__P(apiProcessOrders,1)} - = - - - apiSinglePercentage - ${__P(apiSinglePercentage,0)} - = - - - browseCatalogByCustomerPercentage - ${__P(browseCatalogByCustomerPercentage,0)} - = - - - browseCatalogByGuestPercentage - ${__P(browseCatalogByGuestPercentage,0)} - = - - - browseCustomerGridPercentage - ${__P(browseCustomerGridPercentage,0)} - = - - - browseOrderGridPercentage - ${__P(browseOrderGridPercentage,0)} - = - - - browseProductGridPercentage - ${__P(browseProductGridPercentage,0)} - = - - - cAccountManagementPercentage - ${__P(cAccountManagementPercentage,1)} - = - - - cAddToCartByGuestPercentage - ${__P(cAddToCartByGuestPercentage,26)} - = - - - cAddToWishlistPercentage - ${__P(cAddToWishlistPercentage,1.5)} - = - - - cAdminBrowseCustomerGridPercentage - ${__P(cAdminBrowseCustomerGridPercentage,0.1)} - = - - - cAdminBrowseOrderGridPercentage - ${__P(cAdminBrowseOrderGridPercentage,0.2)} - = - - - cAdminBrowseProductGridPercentage - ${__P(cAdminBrowseProductGridPercentage,0.2)} - = - - - cAdminCMSManagementPercentage - ${__P(cAdminCMSManagementPercentage,0.35)} - = - - - cAdminCategoryManagementPercentage - ${__P(cAdminCategoryManagementPercentage,0.15)} - = - - - cAdminCreateOrderPercentage - ${__P(cAdminCreateOrderPercentage,0.5)} - = - - - cAdminCustomerManagementPercentage - ${__P(cAdminCustomerManagementPercentage,0.4)} - = - - - cAdminEditOrderPercentage - ${__P(cAdminEditOrderPercentage,1)} - = - - - cAdminProductCreationPercentage - ${__P(cAdminProductCreationPercentage,0.5)} - = - - - cAdminProductEditingPercentage - ${__P(cAdminProductEditingPercentage,0.65)} - = - - - cAdminPromotionRulesPercentage - ${__P(cAdminPromotionRulesPercentage,0.2)} - = - - - cAdminReturnsManagementPercentage - ${__P(cAdminReturnsManagementPercentage,0.75)} - = - - - cBrowseCatalogByGuestPercentage - ${__P(cBrowseCatalogByGuestPercentage,29)} - = - - - cCheckoutByCustomerPercentage - ${__P(cCheckoutByCustomerPercentage,3.5)} - = - - - cCheckoutByGuestPercentage - ${__P(cCheckoutByGuestPercentage,3.5)} - = - - - cCompareProductsPercentage - ${__P(cCompareProductsPercentage,1.5)} - = - - - cSiteSearchPercentage - ${__P(cSiteSearchPercentage,29)} - = - - - catalogGraphQLPercentage - ${__P(catalogGraphQLPercentage,0)} - = - - - categories_count - ${__P(categories_count,100)} - = - - - checkoutALargeBulkOfProductsByGuestPercentage - ${__P(checkoutALargeBulkOfProductsByGuestPercentage,0)} - = - - - checkoutByCustomerPercentage - ${__P(checkoutByCustomerPercentage,0)} - = - - - checkoutByGuestPercentage - ${__P(checkoutByGuestPercentage,0)} - = - - - compareProductsPercentage - ${__P(compareProductsPercentage,0)} - = - - - configurable_products_count - ${__P(configurable_products_count,15)} - = - - - customer_checkout_percent - ${__P(customer_checkout_percent,100)} - = - - - customer_password - ${__P(customer_password,)} - = - - - customers_page_size - ${__P(customers_page_size,100)} - = - - - dashboard_enabled - ${__P(dashboard_enabled,0)} - = - - - exportCustomersPercentage - ${__P(exportCustomersPercentage,0)} - = - - - exportProductsPercentage - ${__P(exportProductsPercentage,0)} - = - - - form_key - ${__P(form_key,uVEW54r8kKday8Wk)} - = - - - graphqlAddConfigurableProductToCartPercentage - ${__P(graphqlAddConfigurableProductToCartPercentage,0)} - = - - - graphqlAddSimpleProductToCartPercentage - ${__P(graphqlAddSimpleProductToCartPercentage,0)} - = - - - graphqlApplyCouponToCartPercentage - ${__P(graphqlApplyCouponToCartPercentage,0)} - = - - - graphqlCatalogBrowsingByGuestPercentage - ${__P(graphqlCatalogBrowsingByGuestPercentage,0)} - = - - - graphqlCheckoutALargeBulkOfProductsByGuestPercentage - ${__P(graphqlCheckoutALargeBulkOfProductsByGuestPercentage,0)} - = - - - graphqlCheckoutByGuestPercentage - ${__P(graphqlCheckoutByGuestPercentage,0)} - = - - - graphqlCreateEmptyCartPercentage - ${__P(graphqlCreateEmptyCartPercentage,0)} - = - - - graphqlGetCategoryListByCategoryIdPercentage - ${__P(graphqlGetCategoryListByCategoryIdPercentage,0)} - = - - - graphqlGetCmsPageByIdPercentage - ${__P(graphqlGetCmsPageByIdPercentage,0)} - = - - - graphqlGetCmsPageWithPageBuilderProductListPercentage - ${__P(graphqlGetCmsPageWithPageBuilderProductListPercentage,0)} - = - - - graphqlGetConfigurableProductDetailsByNamePercentage - ${__P(graphqlGetConfigurableProductDetailsByNamePercentage,0)} - = - - - graphqlGetConfigurableProductDetailsByProductUrlKeyPercentage - ${__P(graphqlGetConfigurableProductDetailsByProductUrlKeyPercentage,0)} - = - - - graphqlGetEmptyCartPercentage - ${__P(graphqlGetEmptyCartPercentage,0)} - = - - - graphqlGetListOfProductsByCategoryIdPercentage - ${__P(graphqlGetListOfProductsByCategoryIdPercentage,0)} - = - - - graphqlGetNavigationMenuByCategoryIdPercentage - ${__P(graphqlGetNavigationMenuByCategoryIdPercentage,0)} - = - - - graphqlGetProductSearchByTextAndCategoryIdPercentage - ${__P(graphqlGetProductSearchByTextAndCategoryIdPercentage,0)} - = - - - graphqlGetSimpleProductDetailsByNamePercentage - ${__P(graphqlGetSimpleProductDetailsByNamePercentage,0)} - = - - - graphqlGetSimpleProductDetailsByProductUrlKeyPercentage - ${__P(graphqlGetSimpleProductDetailsByProductUrlKeyPercentage,0)} - = - - - graphqlRemoveConfigurableProductFromCartPercentage - ${__P(graphqlRemoveConfigurableProductFromCartPercentage,0)} - = - - - graphqlRemoveCouponFromCartPercentage - ${__P(graphqlRemoveCouponFromCartPercentage,0)} - = - - - graphqlRemoveSimpleProductFromCartPercentage - ${__P(graphqlRemoveSimpleProductFromCartPercentage,0)} - = - - - graphqlSetBillingAddressOnCartPercentage - ${__P(graphqlSetBillingAddressOnCartPercentage,0)} - = - - - graphqlSetShippingAddressOnCartPercentage - ${__P(graphqlSetShippingAddressOnCartPercentage,0)} - = - - - graphqlUpdateConfigurableProductQtyInCartPercentage - ${__P(graphqlUpdateConfigurableProductQtyInCartPercentage,0)} - = - - - graphqlUpdateConfigurableProductQtyInCartWithPricesPercentage - ${__P(graphqlUpdateConfigurableProductQtyInCartWithPricesPercentage,0)} - = - - - graphqlUpdateSimpleProductQtyInCartPercentage - ${__P(graphqlUpdateSimpleProductQtyInCartPercentage,0)} - = - - - graphqlUpdateSimpleProductQtyInCartWithPricesPercentage - ${__P(graphqlUpdateSimpleProductQtyInCartWithPricesPercentage,0)} - = - - - graphqlUrlInfoByUrlKeyPercentage - ${__P(graphqlUrlInfoByUrlKeyPercentage,0)} - = - - - guest_checkout_percent - ${__P(guest_checkout_percent,100)} - = - - - importCustomersPercentage - ${__P(importCustomersPercentage,0)} - = - - - importProductsPercentage - ${__P(importProductsPercentage,0)} - = - - - numberOfRelatedSimpleProductsInTheCart - ${__P(numberOfRelatedSimpleProductsInTheCart,100)} - = - - - orders_page_size - ${__P(orders_page_size,20)} - = - - - productCompareDelay - ${__P(productCompareDelay,0)} - = - - - productGridMassActionPercentage - ${__P(productGridMassActionPercentage,0)} - = - - - products_page_size - ${__P(products_page_size,20)} - = - - - ramp_period - ${__P(ramp_period,0)} - = - - - redis_host - ${__P(redis_host,)} - = - - - report_save_path - ${__P(report_save_path,./)} - = - - - response_time_file_name - ${__P(response_time_file_name,production.csv)} - = - - - reviewByCustomerPercentage - ${__P(reviewByCustomerPercentage,0)} - = - - - reviewDelay - ${__P(reviewDelay,0)} - = - - - scenario - ${__P(scenario,)} - = - - - searchAdvancedPercentage - ${__P(searchAdvancedPercentage,10)} - = - - - searchQuickFilterPercentage - ${__P(searchQuickFilterPercentage,30)} - = - - - searchQuickPercentage - ${__P(searchQuickPercentage,60)} - = - - - simple_products_count - ${__P(simple_products_count,125)} - = - - - siteSearchPercentage - ${__P(siteSearchPercentage,0)} - = - - - start_time - ${__P(start_time,${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)})} - = - - - starting_index - ${__P(starting_index,0)} - = - - - think_time_delay_offset - ${__P(think_time_delay_offset,2000)} - = - - - think_time_deviation - ${__P(think_time_deviation,1000)} - = - - - url_suffix - ${__P(url_suffix,.html)} - = - - - website_id - ${__P(website_id,1)} - = - - - wishlistDelay - ${__P(wishlistDelay,0)} - = - - - - - - - false - - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - true - false - false - 0 - true - true - true - true - - - - tool/fragments/ce/view_results_tree.jmx - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - true - false - false - false - true - 0 - true - true - true - - - /tmp/aggregate-jmeter-results.jtl - tool/fragments/ce/aggregate_report.jmx - - - - - - - ${host} - - 60000 - 200000 - ${request_protocol} - utf-8 - - Java - 4 - tool/fragments/ce/http_request_default.jmx - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - application/json,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - tool/fragments/ce/http_header_manager.jmx - - - - stoptest - - false - 1 - - 1 - 1 - 1384333221000 - 1384333221000 - false - - - tool/fragments/ce/setup/setup.jmx - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - -props.remove("category_url_key"); -props.remove("category_url_keys_list"); -props.remove("category_name"); -props.remove("category_names_list"); -props.remove("simple_products_list"); -props.remove("simple_products_list_for_edit"); -props.remove("configurable_products_list"); -props.remove("configurable_products_list_for_edit"); -props.remove("users"); -props.remove("customer_emails_list"); -props.remove("categories"); -props.remove("cms_pages"); -props.remove("cms_blocks"); -props.remove("coupon_codes"); - -/* This is only used when admin is enabled. */ -props.put("activeAdminThread", ""); - -/* Set the environment - at this time '01' or '02' */ -String path = "${host}"; -String environment = path.substring(4, 6); -props.put("environment", environment); - - - false - tool/fragments/ce/setup/initialize.jmx - - - - Boolean stopTestOnError (String error) { - log.error(error); - System.out.println(error); - SampleResult.setStopTest(true); - return false; -} - -if ("${host}" == "1") { - return stopTestOnError("\"host\" parameter is not defined. Please define host parameter as: \"-Jhost=example.com\""); -} - -String path = "${base_path}"; -String slash = "/"; -if (!slash.equals(path.substring(path.length() -1)) || !slash.equals(path.substring(0, 1))) { - return stopTestOnError("\"base_path\" parameter is invalid. It must start and end with \"/\""); -} - - - - false - tool/fragments/ce/setup/validate_user_defined_variables.jmx - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path} - GET - true - false - true - false - false - - - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/setup/login.jmx - - - - - <title>Dashboard / Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - - - tool/fragments/ce/setup/extract_admin_users.jmx - - - - - - - false - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/user/roleGrid/limit/200/?ajax=true&isAjax=true - POST - true - false - true - false - false - - - - - - - false - import java.util.regex.Pattern; - import java.util.regex.Matcher; - import java.util.LinkedList; - - LinkedList adminUserList = new LinkedList(); - String response = new String(data); - Pattern pattern = Pattern.compile("<td\\W*?data-column=.username[^>]*?>\\W*?(\\w+)\\W*?<"); - Matcher matcher = pattern.matcher(response); - - while (matcher.find()) { - adminUserList.add(matcher.group(1)); - } - - adminUserList.poll(); - props.put("adminUserList", adminUserList); - props.put("adminUserListIterator", adminUserList.descendingIterator()); - - - - - - - - tool/fragments/ce/setup/extract_customers.jmx - - - - - - - true - customer_listing - = - true - namespace - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - true - customer_since[locale]=en_US - = - true - filters[placeholder] - - - true - 1 - = - true - filters[group_id] - - - true - 1 - = - true - filters[website_id] - - - true - ${customers_page_size} - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - - - - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - - 60000 - 200000 - - - - groovy - - - true - import groovy.json.JsonSlurper -import java.util.ArrayList; -import java.util.LinkedList; - -emailsList = new LinkedList(); -idsList = new ArrayList(); - - -def jsonSlurper = new JsonSlurper(); -def jsonResponse = jsonSlurper.parseText(prev.getResponseDataAsString()); - -jsonResponse.items.each { item -> - emailsList.add(item.email); - idsList.add(item.entity_id.toString()); -} - -props.put("customer_emails_list", emailsList); -props.put("customer_ids_list", idsList); -// -log.info("Cust IDs: " + idsList); -log.info("Emails: " + emailsList); - - - - - - - - tool/fragments/ce/setup/extract_region_ids.jmx - - - - - - - false - US - = - true - parent - - - - - - - - ${request_protocol} - - ${base_path}${admin_path}/directory/json/countryRegion/ - GET - true - false - true - false - false - - - - - groovy - - - - import groovy.json.JsonSlurper -def jsonSlurper = new JsonSlurper(); -def regionResponse = jsonSlurper.parseText(prev.getResponseDataAsString()); - -regionResponse.each { region -> - if (region.label.toString() == "Alabama") { - props.put("alabama_region_id", region.value.toString()); - } else if (region.label.toString() == 'California') { - props.put("california_region_id", region.value.toString()); - } -} - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - - - - - - true - 1 - = - true - searchCriteria[current_page] - - - false - 20 - = - true - searchCriteria[page_size] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/cmsPage/search - GET - true - false - true - false - false - - tool/fragments/ce/setup/get_cms_pages.jmx - - - - $.total_count - 0 - true - false - true - false - - - - javascript - - - - var data = JSON.parse(prev.getResponseDataAsString()); - -var cmsPages = []; - -for (var i in data.items) { - cmsPages.push({"id": data.items[i].id, "identifier": data.items[i].identifier}); - } - -props.put("cms_pages", cmsPages); - - - - - - - - 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] - - - - - - ${request_protocol} - - ${base_path}rest/V1/products - GET - true - false - true - false - - 60000 - 200000 - - - - groovy - - - true - import groovy.json.JsonSlurper -import java.util.ArrayList; -import java.util.LinkedList; -import org.apache.commons.codec.binary.Base64; - -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); -} - -props.put("configurable_products_list", productList); - -log.info("Products: " + productList); - - - - - - - - - - - - tool/fragments/ce/setup/extract_configurable_products_for_edit.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] - - - true - 2 - = - true - searchCriteria[currentPage] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/products - GET - true - false - true - false - false - - - - - false - configurable_products_for_edit_url_keys - url_key\",\"value\":\"(.*?)\" - $1$ - - -1 - - - - false - configurable_product_for_edit_ids - \"id\":(\d+),\"sku\" - $1$ - - -1 - - - - false - configurable_product_for_edit_names - name\":\"(.*?)\" - $1$ - - -1 - - - - false - configurable_product_for_edit_skus - sku\":\"(.*?)\" - $1$ - - -1 - - - - - - configurable_product_for_edit_ids - configurable_product_for_edit_id - true - - - - 1 - - 1 - configurable_products_counter_for_edit - - false - - - - import java.util.ArrayList; -import java.util.HashMap; -import org.apache.commons.codec.binary.Base64; -ArrayList editProductList; - -if (1 == Integer.parseInt(vars.get("configurable_products_counter_for_edit"))) { - editProductList = new ArrayList(); - props.put("configurable_products_list_for_edit", editProductList); -} else { - editProductList = props.get("configurable_products_list_for_edit"); -} - -String productUrl = vars.get("request_protocol") + "://" + vars.get("host") + vars.get("base_path") + vars.get("configurable_products_for_edit_url_keys_" + vars.get("configurable_products_counter_for_edit"))+ vars.get("url_suffix"); -encodedUrl = Base64.encodeBase64(productUrl.getBytes()); -// Create product map -Map editProductMap = new HashMap(); -editProductMap.put("id", vars.get("configurable_product_for_edit_id")); -editProductMap.put("title", vars.get("configurable_product_for_edit_names_" + vars.get("configurable_products_counter_for_edit"))); -editProductMap.put("sku", vars.get("configurable_product_for_edit_skus_" + vars.get("configurable_products_counter_for_edit"))); -editProductMap.put("url_key", vars.get("configurable_products_for_edit_url_keys_" + vars.get("configurable_products_counter_for_edit"))); -editProductMap.put("uenc", new String(encodedUrl)); - -// Collect products map in products list -editProductList.add(editProductMap); - - - false - - - - - - tool/fragments/ce/setup/extract_simple_products.jmx - - - - - - - true - type_id - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - true - simple - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - true - ${simple_products_count} - = - true - searchCriteria[pageSize] - - - true - attribute_set_id - != - true - searchCriteria[filterGroups][0][filters][1][field] - - - true - 4 - = - true - searchCriteria[filterGroups][0][filters][1][value] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/products - GET - true - false - true - false - false - - - - - false - simple_products_url_keys - url_key\",\"value\":\"(.*?)\" - $1$ - - -1 - - - - false - simple_product_ids - \"id\":(\d+),\"sku\" - $1$ - - -1 - - - - false - simple_product_names - name\":\"(.*?)\" - $1$ - - -1 - - - - false - simple_product_skus - sku\":\"(.*?)\" - $1$ - - -1 - - - - - - simple_product_ids - simple_product_id - true - - - - 1 - - 1 - simple_products_counter - - false - - - - import java.util.ArrayList; -import java.util.HashMap; -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("simple_products_counter"))) { - productList = new ArrayList(); - props.put("simple_products_list", productList); -} else { - productList = props.get("simple_products_list"); -} -String productUrl = vars.get("request_protocol") + "://" + vars.get("host") + vars.get("base_path") + vars.get("simple_products_url_keys_" + vars.get("simple_products_counter"))+ vars.get("url_suffix"); -encodedUrl = Base64.encodeBase64(productUrl.getBytes()); -// Create product map -Map productMap = new HashMap(); -productMap.put("id", vars.get("simple_product_id")); -productMap.put("title", vars.get("simple_product_names_" + vars.get("simple_products_counter"))); -productMap.put("sku", vars.get("simple_product_skus_" + vars.get("simple_products_counter"))); -productMap.put("url_key", vars.get("simple_products_url_keys_" + vars.get("simple_products_counter"))); -productMap.put("uenc", new String(encodedUrl)); - -// Collect products map in products list -productList.add(productMap); - - - false - - - - - - tool/fragments/ce/setup/extract_simple_products_for_edit.jmx - - - - - - - true - type_id - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - true - simple - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - true - ${simple_products_count} - = - true - searchCriteria[pageSize] - - - true - 1 - = - true - searchCriteria[currentPage] - - - true - attribute_set_id - = - true - searchCriteria[filterGroups][1][filters][1][field] - - - true - 4 - = - true - searchCriteria[filterGroups][1][filters][1][value] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/products - GET - true - false - true - false - false - - - - - false - simple_products_for_edit_url_keys - url_key\",\"value\":\"(.*?)\" - $1$ - - -1 - - - - false - simple_product_for_edit_ids - \"id\":(\d+),\"sku\" - $1$ - - -1 - - - - false - simple_product_for_edit_names - name\":\"(.*?)\" - $1$ - - -1 - - - - false - simple_product_for_edit_skus - sku\":\"(.*?)\" - $1$ - - -1 - - - - - - simple_product_for_edit_ids - simple_product_for_edit_id - true - - - - 1 - - 1 - simple_products_counter_for_edit - - false - - - - import java.util.ArrayList; -import java.util.HashMap; -import org.apache.commons.codec.binary.Base64; -ArrayList editProductList; - -if (1 == Integer.parseInt(vars.get("simple_products_counter_for_edit"))) { - editProductList = new ArrayList(); - props.put("simple_products_list_for_edit", editProductList); -} else { - editProductList = props.get("simple_products_list_for_edit"); -} - -String productUrl = vars.get("request_protocol") + "://" + vars.get("host") + vars.get("base_path") + vars.get("simple_products_for_edit_url_keys_" + vars.get("simple_products_counter_for_edit"))+ vars.get("url_suffix"); -encodedUrl = Base64.encodeBase64(productUrl.getBytes()); -// Create product map -Map editProductMap = new HashMap(); -editProductMap.put("id", vars.get("simple_product_for_edit_id")); -editProductMap.put("title", vars.get("simple_product_for_edit_names_" + vars.get("simple_products_counter_for_edit"))); -editProductMap.put("sku", vars.get("simple_product_for_edit_skus_" + vars.get("simple_products_counter_for_edit"))); -editProductMap.put("url_key", vars.get("simple_products_for_edit_url_keys_" + vars.get("simple_products_counter_for_edit"))); -editProductMap.put("uenc", new String(encodedUrl)); - -// Collect products map in products list -editProductList.add(editProductMap); - - - false - - - - - - tool/fragments/ce/setup/extract_categories.jmx - - - - - - - true - path - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - true - 1/2/% - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - true - like - = - true - searchCriteria[filterGroups][0][filters][0][conditionType] - - - true - level - = - true - searchCriteria[filterGroups][1][filters][0][field] - - - true - 2 - = - true - searchCriteria[filterGroups][1][filters][0][value] - - - true - ${categories_count} - = - true - searchCriteria[pageSize] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/categories/list - GET - true - false - false - false - false - - - - - javascript - - - - var data = JSON.parse(prev.getResponseDataAsString()); - -var categoryData = [], categoryNames = [], categoryUrls = []; - -for (var i in data.items) { - var cat = data.items[i], urlKey = getUrlKey(cat); - categoryData.push({"id": cat.id, "name": cat.name, "url_key": urlKey, "children": cat.children.split(",")}); - categoryNames.push(cat.name); - categoryUrls.push(urlKey); - } - -function getUrlKey(cat) { - for (var i in cat.custom_attributes) { - if (cat.custom_attributes[i].attribute_code == "url_key") { - return cat.custom_attributes[i].value; - } - } - return ""; -} - -props.put("categories", categoryData); -props.put("category_url_keys_list", categoryUrls); -props.put("category_names_list",categoryNames); - - - - - - - tool/fragments/ce/setup/extract_categories_id_of_last_level.jmx - - - - props.remove("admin_category_ids_list"); - - - false - - - - - - - true - children_count - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - true - 0 - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - true - level - = - true - searchCriteria[filterGroups][1][filters][0][field] - - - true - 2 - = - true - searchCriteria[filterGroups][1][filters][0][value] - - - true - gt - = - true - searchCriteria[filterGroups][1][filters][0][conditionType] - - - true - ${adminCategoryCount} - = - true - searchCriteria[pageSize] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/categories/list - GET - true - false - true - false - false - - - - - false - category_list_id - \{\"id\":(\d+), - $1$ - - -1 - - - - - category_list_id - category_id - true - - - - import java.util.ArrayList; - -adminCategoryIdsList = props.get("admin_category_ids_list"); -// If it is first iteration of cycle then recreate categories ids list -if (adminCategoryIdsList == null) { - adminCategoryIdsList = new ArrayList(); - props.put("admin_category_ids_list", adminCategoryIdsList); -} -adminCategoryIdsList.add(vars.get("category_id")); - - - false - - - - - - - tool/fragments/ce/setup/extract_coupon_codes.jmx - - - - - - - false - 10 - = - true - searchCriteria[pageSize] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/coupons/search - GET - true - false - true - false - false - - - - - javascript - - - - var data = JSON.parse(prev.getResponseDataAsString()); - -var couponCodes = []; - -for (var i in data.items) { - var coupon = data.items[i]; - couponCodes.push({"coupon_id":coupon.coupon_id, "rule_id":coupon.rule_id, "code": coupon.code}); - } - -props.put("coupon_codes", couponCodes); - - - - - - - - - Boolean stopTestOnError (String error) { - log.error(error); - System.out.println(error); - SampleResult.setStopTest(true); - return false; -} - -if (props.get("simple_products_list") == null) { - return stopTestOnError("Cannot find simple products. Test stopped."); -} -if (props.get("simple_products_list_for_edit") == null) { - return stopTestOnError("Cannot find simple products for edit. Test stopped."); -} -if (props.get("configurable_products_list") == null) { - return stopTestOnError("Cannot find configurable products. Test stopped."); -} -if (props.get("configurable_products_list_for_edit") == null) { - return stopTestOnError("Cannot find configurable products for edit. Test stopped."); -} -if (props.get("customer_emails_list") == null) { - return stopTestOnError("Cannot find customer emails. Test stopped."); -} -if (props.get("category_url_keys_list") == null) { - return stopTestOnError("Cannot find category url keys. Test stopped."); -} -if (props.get("category_names_list") == null) { - return stopTestOnError("Cannot find category names. Test stopped."); -} -if (props.get("cms_pages") == null) { - return stopTestOnError("Cannot find cms pages. Test stopped."); -} - - - - false - tool/fragments/ce/setup/validate_properties.jmx - - - - - - - true - 1 - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add - POST - true - false - true - false - false - - tool/fragments/ce/setup/warmup_add_to_cart.jmx - - - - - continue - - false - ${loops} - - ${frontendPoolUsers} - ${ramp_period} - 1505803944000 - 1505803944000 - false - - - tool/fragments/_system/thread_group.jmx - - - javascript - - - - var cacheHitPercent = vars.get("cache_hits_percentage"); - -if ( - cacheHitPercent < 100 && - sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - doCache(); -} - -function doCache(){ - var random = Math.random() * 100; - if (cacheHitPercent < random) { - sampler.setPath(sampler.getPath() + "?cacheModifier=" + Math.random().toString(36).substring(2, 13)); - } -} - - tool/fragments/ce/common/cache_hit_miss.jmx - - - - 1 - false - 1 - ${browseCatalogByCustomerPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Catalog Browsing By Customer"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/login/ - GET - true - false - true - false - false - - tool/fragments/ce/common/open_login_page.jmx - - - - <title>Customer Login</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${customer_email} - = - true - login[username] - - - true - ${customer_password} - = - true - login[password] - - - true - - = - true - send - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/loginPost/ - POST - true - false - true - false - false - - tool/fragments/ce/common/login.jmx - - - - <title>My Account</title> - - Assertion.response_data - false - 2 - - - - false - addressId - customer/address/edit/id/([^'"]+)/ - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - addressId - - - - - - - - true - - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/common/logout.jmx - - - - You are signed out. - - Assertion.response_data - false - 2 - - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${browseCatalogByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Catalog Browsing By Guest"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${siteSearchPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Site Search"); - - true - - - - - ${files_folder}search_terms.csv - UTF-8 - - , - false - true - false - shareMode.thread - tool/fragments/ce/search/search_terms.jmx - - - - javascript - - - - var cacheHitPercent = vars.get("cache_hits_percentage"); - -if ( - cacheHitPercent < 100 && - sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - doCache(); -} - -function doCache(){ - var random = Math.random() * 100; - if (cacheHitPercent < random) { - sampler.setPath(sampler.getPath() + "?cacheModifier=" + Math.random().toString(36).substring(2, 13)); - } -} - - tool/fragments/ce/common/cache_hit_miss.jmx - - - - 1 - false - 1 - ${searchQuickPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Quick Search"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - q - ${searchTerm} - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalogsearch/result/ - GET - true - false - true - false - false - - tool/fragments/ce/search/search_quick.jmx - - - - Search results for: - <span class="toolbar-number">\d<\/span> Items|Items <span class="toolbar-number">1 - - Assertion.response_data - false - 2 - - - - false - product_url_keys - <a class="product-item-link"(?s).+?href="(?:http|https)://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s). - $2$ - - -1 - - - - false - isPageCacheable - catalogsearch/searchTermsLog/save - $0$ - 0 - 1 - - - - - - "${isPageCacheable}" != "0" - false - tool/fragments/ce/search/if_page_cacheable_controller.jmx - - - - - - true - q - ${searchTerm} - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalogsearch/searchTermsLog/save/ - GET - true - false - true - false - false - - tool/fragments/ce/search/search_terms_log_save.jmx - - - - - "success":true - - Assertion.response_data - false - 2 - - - - - - - -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup.jmx - -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${searchQuickFilterPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Quick Search With Filtration"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - q - ${searchTerm} - = - true - - - - - - 60000 - 200000 - - - ${base_path}catalogsearch/result/ - GET - true - false - true - false - false - - tool/fragments/ce/search/search_quick_filter.jmx - - - - Search results for: - Items <span class="toolbar-number">1 - - Assertion.response_data - false - 2 - - - - 0 - attribute_1_options_count - count((//div[@class="filter-options-content"])[1]//li[@class="item"]) - false - true - false - - - - 0 - attribute_2_options_count - count((//div[@class="filter-options-content"])[2]//li[@class="item"]) - false - true - false - - - - - attribute_1_filter_url - ((//div[@class="filter-options-content"])[1]//li[@class="item"]//a)[1]/@href - false - true - false - - - - false - product_url_keys - <a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s). - $2$ - - -1 - - - - false - isPageCacheable - catalogsearch/searchTermsLog/save - $0$ - 0 - 1 - - - - - - "${isPageCacheable}" != "0" - false - tool/fragments/ce/search/if_page_cacheable_controller.jmx - - - - - - true - q - ${searchTerm} - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalogsearch/searchTermsLog/save/ - GET - true - false - true - false - false - - tool/fragments/ce/search/search_terms_log_save.jmx - - - - - "success":true - - Assertion.response_data - false - 2 - - - - - - - ${attribute_1_options_count} > 0 - false - tool/fragments/ce/search/search_quick_filter-first-attribute.jmx - - - vars.put("search_url", vars.get("attribute_1_filter_url")); - - - false - - - - - - - - - 60000 - 200000 - - - ${attribute_1_filter_url} - GET - true - false - true - false - false - - - - - - Search results for: - <span class="toolbar-number">[1-9]+ - - Assertion.response_data - false - 2 - - - - 0 - attribute_2_options_count - count((//div[@class="filter-options-content"])[2]//li[@class="item"]) - false - true - false - - - - - attribute_2_filter_url - ((//div[@class="filter-options-content"])[2]//li[@class="item"]//a)[1]/@href - false - true - false - - - - false - product_url_keys - <a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s). - $2$ - - -1 - - - - - - - ${attribute_2_options_count} > 0 - false - tool/fragments/ce/search/search_quick_filter-second-attribute.jmx - - - vars.put("search_url", vars.get("attribute_2_filter_url")); - - - false - - - - - - - - - 60000 - 200000 - - - ${attribute_2_filter_url} - GET - true - false - true - false - false - - - - - - Search results for: - <span class="toolbar-number">[1-9]+ - - Assertion.response_data - false - 2 - - - - false - product_url_keys - <a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s). - $2$ - - -1 - - - - - - - -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup.jmx - -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${searchAdvancedPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Advanced Search"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - - 60000 - 200000 - - - ${base_path}catalogsearch/advanced/ - GET - true - false - true - false - false - - tool/fragments/ce/search/open_advanced_search_page.jmx - - - - <title>Advanced Search</title> - - Assertion.response_data - false - 2 - - - - - attribute_name - (//select[@class="multiselect"])[last()]/@name - false - true - false - - - - 0 - attribute_options_count - count((//select[@class="multiselect"])[last()]/option) - false - true - false - - - - - attribute_value - ((//select[@class="multiselect"])[last()]/option)[1]/@value - false - true - false - - - - - - - - - - - true - name - - = - true - - - true - sku - - = - true - - - true - description - ${searchTerm} - = - true - - - true - short_description - - = - true - - - true - price%5Bfrom%5D - - = - true - - - true - price%5Bto%5D - ${priceTo} - = - true - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalogsearch/advanced/result/ - GET - true - false - true - false - false - - tool/fragments/ce/search/search_advanced.jmx - - - - items</strong> were found using the following search criteria - - Assertion.response_data - false - 2 - - - - false - product_url_keys - <a class="product-item-link"(?s).+?href="(?:http|https)://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s). - $2$ - - -1 - - - - - - -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup.jmx - -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - - - 1 - false - 1 - ${addToCartByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Add To Cart By Guest"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - true - 1 - tool/fragments/ce/common/get_configurable_product_options.jmx - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - 1 - false - 1 - ${addToWishlistPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Add to Wishlist"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/login/ - GET - true - false - true - false - false - - tool/fragments/ce/common/open_login_page.jmx - - - - <title>Customer Login</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${customer_email} - = - true - login[username] - - - true - ${customer_password} - = - true - login[password] - - - true - - = - true - send - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/loginPost/ - POST - true - false - true - false - false - - tool/fragments/ce/common/login.jmx - - - - <title>My Account</title> - - Assertion.response_data - false - 2 - - - - false - addressId - customer/address/edit/id/([^'"]+)/ - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - addressId - - - - - - - - true - - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - true - 5 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - false - - - true - ${product_uenc} - = - true - uenc - - - true - ${product_id} - = - true - product - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}wishlist/index/add/ - POST - true - false - true - false - false - - tool/fragments/ce/wishlist/add_to_wishlist.jmx - - - - <title>My Wish List</title> - - Assertion.response_data - false - 16 - - - - false - wishListItems - data-post-remove='\{"action":"(.+)\/wishlist\\/index\\/remove\\/","data":\{"item":"([^"]+)" - $2$ - - -1 - - - - - - - - - true - wishlist,messages - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/wishlist/load_wishlist_section.jmx - - - - {"wishlist":{"counter":" - - Assertion.response_data - false - 16 - - - - ${wishlistDelay}*1000 - - - - - - - wishListItems - wishListItem - true - tool/fragments/ce/wishlist/clear_wishlist.jmx - - - 1 - 5 - 1 - counter - - true - true - - - - - - - true - ${form_key} - = - true - form_key - true - - - true - ${wishListItem} - = - true - item - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}wishlist/index/remove/ - POST - true - false - true - false - false - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/common/logout.jmx - - - - You are signed out. - - Assertion.response_data - false - 2 - - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${compareProductsPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Compare Products"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_compare/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - random_product_compare_id - catalog\\/product_compare\\/add\\/\",\"data\":\{\"product\":\"([0-9]+)\" - $1$ - - 1 - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - random_product_compare_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - ${form_key} - = - true - form_key - - - true - ${product_uenc} - = - true - uenc - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalog/product_compare/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_compare/product_compare_add.jmx - - - - - - - true - compare-products,messages - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx - - - - \"compare-products\":{\"count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - ${form_key} - = - true - form_key - - - true - ${product_uenc} - = - true - uenc - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalog/product_compare/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_compare/product_compare_add.jmx - - - - - - - true - compare-products,messages - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx - - - - \"compare-products\":{\"count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalog/product_compare/index/ - GET - true - false - true - false - false - - tool/fragments/ce/product_compare/compare_products.jmx - - - - 1 - 0 - ${__javaScript(Math.round(${productCompareDelay}*1000))} - tool/fragments/ce/product_compare/compare_products_pause.jmx - - - - - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalog/product_compare/clear - POST - true - false - true - false - false - - tool/fragments/ce/product_compare/compare_products_clear.jmx - - - - - - 1 - false - 1 - ${checkoutByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Checkout By Guest"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - true - 1 - tool/fragments/ce/common/get_configurable_product_options.jmx - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/ - GET - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_start.jmx - - - - <title>Checkout</title> - - Assertion.response_data - false - 2 - - - - - <title>Shopping Cart</title> - - Assertion.response_data - false - 6 - - - - false - cart_id - "quoteData":{"entity_id":"([^'"]+)", - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - - - true - - - - false - {"customerEmail":"test@example.com"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/customers/isEmailAvailable - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_email_available.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - true - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"address":{"country_id":"US","postcode":"95630"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/estimate-shipping-methods - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "available":true - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"addressInformation":{"shipping_address":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"},"shipping_method_code":"flatrate","shipping_carrier_code":"flatrate"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/shipping-information - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - {"payment_methods": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"cartId":"${cart_id}","email":"test@example.com","paymentMethod":{"method":"checkmo","po_number":null,"additional_data":null},"billingAddress":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/payment-information - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "[0-9]+" - - Assertion.response_data - false - 2 - - - - order_id - $ - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/onepage/success/ - GET - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_success.jmx - - - - Thank you for your purchase! - Your order # is - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${checkoutALargeBulkOfProductsByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Checkout A Large Bulk Of Products By Guest"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - tool/fragments/ce/common/init_total_simple_and_configurable_products_in_cart_setup.jmx - -vars.put("totalSimpleProductsAdded", "0"); -vars.put("totalConfigurableProductsAdded", "0"); - - - - true - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -simpleProductsAdded = Integer.parseInt(vars.get("totalSimpleProductsAdded")); -lastSimpleProduct = Integer.parseInt(vars.get("numberOfRelatedSimpleProductsInTheCart")) - 1; - -product = props.get("simple_products_list").get(lastSimpleProduct); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - -simpleProductsAdded = simpleProductsAdded + 1; -vars.put("totalSimpleProductsAdded", String.valueOf(simpleProductsAdded)); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup_large_bulk_of_products.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx - - - groovy - - - true - - numberOfSimpleProducts = Integer.parseInt(vars.get("numberOfRelatedSimpleProductsInTheCart")) - 1; - def relatedProductIds = props.get('simple_products_list').take(numberOfSimpleProducts).inject('') {acc, prod -> acc + prod.get("id") + ',' }; - sampler.addArgument('related_product', relatedProductIds); - - simpleProductsAdded = Integer.parseInt(vars.get("totalSimpleProductsAdded")); - simpleProductsAdded = simpleProductsAdded + numberOfSimpleProducts; - vars.put("totalSimpleProductsAdded", String.valueOf(simpleProductsAdded)); - - productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); - productsAdded = productsAdded + numberOfSimpleProducts; - vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - tool/fragments/ce/common/related_products_add_to_cart_preprocessor.jmx - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section_with_total_count.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -configurableProductsAdded = Integer.parseInt(vars.get("totalConfigurableProductsAdded")); - -product = props.get("configurable_products_list").get(configurableProductsAdded); - -vars.put("product_number", configurableProductsAdded.toString()); -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - -configurableProductsAdded = configurableProductsAdded + 1; -vars.put("totalConfigurableProductsAdded", String.valueOf(configurableProductsAdded)); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup_large_number_of_products.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - true - 1 - tool/fragments/ce/common/get_configurable_product_options.jmx - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section_with_total_count.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - - - ${base_path}checkout/cart/ - GET - true - false - true - false - false - - tool/fragments/ce/open_cart.jmx - - - - <title>Shopping Cart</title> - - Assertion.response_data - false - 2 - - - - - \"items_count\":\"${totalProductsAdded}\" - - Assertion.response_data - false - 2 - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - - - ${base_path}checkout/cart/ - GET - true - false - true - false - false - - tool/fragments/ce/open_cart.jmx - - - - <title>Shopping Cart</title> - - Assertion.response_data - false - 2 - - - - - \"items_count\":\"${totalProductsAdded}\" - - Assertion.response_data - false - 2 - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/ - GET - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_start.jmx - - - - <title>Checkout</title> - - Assertion.response_data - false - 2 - - - - - <title>Shopping Cart</title> - - Assertion.response_data - false - 6 - - - - false - cart_id - "quoteData":{"entity_id":"([^'"]+)", - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - - - true - - - - false - {"customerEmail":"test@example.com"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/customers/isEmailAvailable - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_email_available.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - true - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"address":{"country_id":"US","postcode":"95630"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/estimate-shipping-methods - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "available":true - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"addressInformation":{"shipping_address":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"},"shipping_method_code":"flatrate","shipping_carrier_code":"flatrate"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/shipping-information - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - {"payment_methods": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"cartId":"${cart_id}","email":"test@example.com","paymentMethod":{"method":"checkmo","po_number":null,"additional_data":null},"billingAddress":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/payment-information - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "[0-9]+" - - Assertion.response_data - false - 2 - - - - order_id - $ - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/onepage/success/ - GET - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_success.jmx - - - - Thank you for your purchase! - Your order # is - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${checkoutByCustomerPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Checkout By Customer"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/login/ - GET - true - false - true - false - false - - tool/fragments/ce/common/open_login_page.jmx - - - - <title>Customer Login</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${customer_email} - = - true - login[username] - - - true - ${customer_password} - = - true - login[password] - - - true - - = - true - send - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/loginPost/ - POST - true - false - true - false - false - - tool/fragments/ce/common/login.jmx - - - - <title>My Account</title> - - Assertion.response_data - false - 2 - - - - false - addressId - customer/address/edit/id/([^'"]+)/ - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - addressId - - - - - - - - true - - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - true - 1 - tool/fragments/ce/common/get_configurable_product_options.jmx - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/ - GET - true - false - true - false - false - - tool/fragments/ce/customer_checkout/checkout_start.jmx - - - - <title>Checkout</title> - - Assertion.response_data - false - 2 - - - - - <title>Shopping Cart</title> - - Assertion.response_data - false - 6 - - - - false - cart_id - "quoteData":{"entity_id":"([^'"]+)", - $1$ - - 1 - - - - false - address_id - "default_billing":"([^'"]+)", - $1$ - - 1 - - - - false - customer_id - "customer_id":([^'",]+), - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - - [0-9]+$ - - Assertion.response_data - false - 1 - variable - address_id - - - - - [0-9]+$ - - Assertion.response_data - false - 1 - variable - customer_id - - - - - - true - - - - false - {"addressId":"${addressId}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id - POST - true - false - true - false - false - - tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "available":true - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"addressInformation":{"shipping_address":{"customerAddressId":"${address_id}","countryId":"US","regionId":"${alabama_region_id}","regionCode":"AL","region":"Alabama","customerId":"${customer_id}","street":["123 Freedom Blvd. #123"],"telephone":"022-333-4455","postcode":"123123","city":"Fayetteville","firstname":"Anthony","lastname":"Nealy"},"shipping_method_code":"flatrate","shipping_carrier_code":"flatrate"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/shipping-information - POST - true - false - true - false - false - - tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx - - - - - Referer - ${host}${base_path}checkout/onepage - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - {"payment_methods" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"cartId":"${cart_id}","paymentMethod":{"method":"checkmo","po_number":null,"additional_data":null},"billingAddress":{"customerAddressId":"${address_id}","countryId":"US","regionId":"${alabama_region_id}","regionCode":"AL","region":"Alabama","customerId":"${customer_id}","street":["123 Freedom Blvd. #123"],"telephone":"022-333-4455","postcode":"123123","city":"Fayetteville","firstname":"Anthony","lastname":"Nealy"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/payment-information - POST - true - false - true - false - false - - tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx - - - - - Referer - ${host}${base_path}checkout/onepage - - - Content-Type - application/json; charset=UTF-8 - - - Accept - application/json - - - X-Requested-With - XMLHttpRequest - - - - - - - "[0-9]+" - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/onepage/success/ - GET - true - false - true - false - false - - tool/fragments/ce/customer_checkout/checkout_success.jmx - - - - Thank you for your purchase! - Your order number is - - Assertion.response_data - false - 2 - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/common/logout.jmx - - - - You are signed out. - - Assertion.response_data - false - 2 - - - - - false - - - curSampler = ctx.getCurrentSampler(); -if(curSampler.getName().contains("Checkout success")) { - manager = curSampler.getCookieManager(); - manager.clear(); -} - - tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${reviewByCustomerPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Product Review By Customer"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/login/ - GET - true - false - true - false - false - - tool/fragments/ce/common/open_login_page.jmx - - - - <title>Customer Login</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${customer_email} - = - true - login[username] - - - true - ${customer_password} - = - true - login[password] - - - true - - = - true - send - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/loginPost/ - POST - true - false - true - false - false - - tool/fragments/ce/common/login.jmx - - - - <title>My Account</title> - - Assertion.response_data - false - 2 - - - - false - addressId - customer/address/edit/id/([^'"]+)/ - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - addressId - - - - - - - - true - - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - - - true - 3 - = - true - ratings[1] - - - true - - = - true - validate_rating - - - true - FirstName - = - true - nickname - - - true - Some Review Title - = - true - title - - - true - Some Review Text - = - true - detail - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}review/product/post/id/${product_id} - POST - true - false - true - false - false - - tool/fragments/ce/product_review/product_review.jmx - - - - HTTP/1.1 200 OK - - Assertion.response_headers - false - 16 - - - - - - - - - true - review,messages - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/product_review/load_review.jmx - - - - 1 - 0 - ${__javaScript(Math.round(${reviewDelay}*1000))} - tool/fragments/ce/product_review/product_review_pause.jmx - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/common/logout.jmx - - - - You are signed out. - - Assertion.response_data - false - 2 - - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${addToCartByCustomerPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Add To Cart By Customer"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/login/ - GET - true - false - true - false - false - - tool/fragments/ce/common/open_login_page.jmx - - - - <title>Customer Login</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${customer_email} - = - true - login[username] - - - true - ${customer_password} - = - true - login[password] - - - true - - = - true - send - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/loginPost/ - POST - true - false - true - false - false - - tool/fragments/ce/common/login.jmx - - - - <title>My Account</title> - - Assertion.response_data - false - 2 - - - - false - addressId - customer/address/edit/id/([^'"]+)/ - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - addressId - - - - - - - - true - - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - true - 1 - tool/fragments/ce/common/get_configurable_product_options.jmx - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - - - ${base_path}checkout/cart/ - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/open_cart.jmx - - - - <title>Shopping Cart</title> - - Assertion.response_data - false - 2 - - - - false - cart_items_qty_inputs - name="cart\[([^\[\]]+)\]\[qty\]" - $1$ - - -1 - - - - - - true - ${cart_items_qty_inputs_matchNr} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -id = vars.get("_counter"); -vars.put("uenc", vars.get("cart_items_uencs_" + id)); -vars.put("item_id", vars.get("cart_items_qty_inputs_" + id)); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/remove_item_from_cart_setup.jmx - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${uenc} - = - true - uenc - - - false - ${item_id} - = - true - id - - - - - - 60000 - 200000 - - - ${base_path}checkout/cart/delete/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/remove_item_from_cart.jmx - - - - - - - true - cart - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/check_cart_is_empty.jmx - - - - \"summary_count\":0 - - Assertion.response_data - false - 2 - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/common/logout.jmx - - - - You are signed out. - - Assertion.response_data - false - 2 - - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${accountManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Account management"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/login/ - GET - true - false - true - false - false - - tool/fragments/ce/common/open_login_page.jmx - - - - <title>Customer Login</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${customer_email} - = - true - login[username] - - - true - ${customer_password} - = - true - login[password] - - - true - - = - true - send - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/loginPost/ - POST - true - false - true - false - false - - tool/fragments/ce/common/login.jmx - - - - <title>My Account</title> - - Assertion.response_data - false - 2 - - - - false - addressId - customer/address/edit/id/([^'"]+)/ - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - addressId - - - - - - - - true - - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}sales/order/history/ - GET - true - false - true - false - false - - tool/fragments/ce/account_management/my_orders.jmx - - - - <title>My Orders</title> - - Assertion.response_data - false - 2 - - - - false - orderId - sales/order/view/order_id/(\d+)/ - $1$ - NOT_FOUND - 1 - - - - - - tool/fragments/ce/account_management/if_orders.jmx - "${orderId}" != "NOT_FOUND" - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}sales/order/view/order_id/${orderId} - GET - true - false - true - false - false - - - - - - <title>Order # - - Assertion.response_data - false - 2 - - - - false - shipment_tab - sales/order/shipment/order_id/(\d+)..Order Shipments - $1$ - NOT_FOUND - 1 - - - - - May not have shipped - "${shipment_tab}" != "NOT_FOUND" - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}sales/order/shipment/order_id/${orderId} - GET - true - false - true - false - false - - - - - - Track this shipment - - Assertion.response_data - false - 2 - - - - false - popupLink - popupWindow": {"windowURL":"([^'"]+)", - $1$ - - 1 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${popupLink} - GET - true - false - true - false - false - - - - - - <title>Tracking Information</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}downloadable/customer/products - GET - true - false - true - false - false - - tool/fragments/ce/account_management/my_downloadable_products.jmx - - - - <title>My Downloadable Products</title> - - Assertion.response_data - false - 2 - - - - false - orderId - sales/order/view/order_id/(\d+)/ - $1$ - NOT_FOUND - 1 - - - - false - linkId - downloadable/download/link/id/(\d+)/ - $1$ - - 1 - - - - - - tool/fragments/ce/account_management/if_downloadables.jmx - "${orderId}" != "NOT_FOUND" - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}sales/order/view/order_id/${orderId} - GET - true - false - true - false - false - - tool/fragments/ce/account_management/view_downloadable_products.jmx - - - - <title>Order # - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}downloadable/download/link/id/${linkId} - GET - true - false - true - false - false - - tool/fragments/ce/account_management/download_product.jmx - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}wishlist - GET - true - false - true - false - false - - - - - - <title>My Wish List</title> - - Assertion.response_data - false - 2 - - - - false - wishlistId - wishlist/index/update/wishlist_id/([^'"]+)/ - $1$ - - 1 - tool/fragments/ce/account_management/my_wish_list.jmx - - - - false - buttonTitle - Update Wish List - FOUND - NOT_FOUND - 1 - - - - - - tool/fragments/ce/account_management/if_wishlist.jmx - "${buttonTitle}" === "FOUND" - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}wishlist/index/share/wishlist_id/${wishlistId}/ - GET - true - false - true - false - false - - tool/fragments/ce/account_management/share_wish_list.jmx - - - - <title>Wish List Sharing</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - true - - - true - ${customer_email} - = - true - emails - - - true - [TEST] See my wishlist!!! - = - true - message - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}wishlist/index/send/wishlist_id/${wishlistId}/ - POST - true - false - true - false - false - - tool/fragments/ce/account_management/send_wish_list.jmx - - - - <title>My Wish List</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/common/logout.jmx - - - - You are signed out. - - Assertion.response_data - false - 2 - - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - - - - - - continue - - false - ${loops} - - ${adminPoolUsers} - ${ramp_period} - 1505803944000 - 1505803944000 - false - - - tool/fragments/_system/thread_group.jmx - - - 1 - false - 1 - ${adminCMSManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Admin CMS Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_cms_management/admin_cms_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/ - GET - true - false - true - false - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/new - GET - true - false - true - false - false - - - - - - - - true - <p>CMS Content ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - content - - - true - - = - true - content_heading - - - true - ${admin_form_key} - = - true - form_key - - - true - - = - true - identifier - - - true - 1 - = - true - is_active - - - true - - = - true - layout_update_xml - - - true - - = - true - meta_description - - - true - - = - true - meta_keywords - - - true - - = - true - meta_title - - - false - {} - = - true - nodes_data - - - true - - = - true - node_ids - - - true - - = - true - page_id - - - true - 1column - = - true - page_layout - - - true - 0 - = - true - store_id[0] - - - true - CMS Title ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - title - - - true - 0 - = - true - website_root - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/save/ - POST - true - false - true - false - false - - - - - - You saved the page. - - Assertion.response_data - false - 16 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCMSManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${browseProductGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Browse Product Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Product"); - - pagesCount = parseInt(vars.get("products_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "product_listing"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_product_filter_text")); - vars.put("grid_filter_field", "name"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "name"); - vars.put("grid_sort_field_2", "price"); - vars.put("grid_sort_field_3", "attribute_set_id"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_products_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${browseOrderGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Browse Order Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Order"); - - pagesCount = parseInt(vars.get("orders_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "sales_order_grid"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_orders_filter_text")); - vars.put("grid_filter_field", "status"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "increment_id"); - vars.put("grid_sort_field_2", "created_at"); - vars.put("grid_sort_field_3", "billing_name"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_orders_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${adminProductCreationPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Admin Create Product"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/once_only_controller.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(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom}); -} -relatedIndex = random.nextInt(props.get("simple_products_list").size()); -vars.put("related_product_id", props.get("simple_products_list").get(relatedIndex).get("id")); - - - true - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - - - - false - mycolor - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - false - attribute_code - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - false - mysize - = - true - searchCriteria[filterGroups][0][filters][1][value] - - - false - attribute_code - = - true - searchCriteria[filterGroups][0][filters][1][field] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/attributes - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/get_product_attributes.jmx - - - product_attributes - $.items - - - BODY - - - - javascript - - - - -var attributesData = JSON.parse(vars.get("product_attributes")), -maxOptions = 2; - -attributes = []; -for (i in attributesData) { - if (i >= 2) { - break; - } - var data = attributesData[i], - attribute = { - "id": data.attribute_id, - "code": data.attribute_code, - "label": data.default_frontend_label, - "options": [] - }; - - var processedOptions = 0; - for (optionN in data.options) { - var option = data.options[optionN]; - if (parseInt(option.value) > 0 && processedOptions < maxOptions) { - processedOptions++; - attribute.options.push(option); - } - } - attributes.push(attribute); -} - -vars.putObject("product_attributes", attributes); - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product_set/index/filter/${attribute_set_filter} - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx - - - - false - attribute_set_id - catalog&#x2F;product_set&#x2F;edit&#x2F;id&#x2F;([\d]+)&#x2F;"[\D\d]*Attribute Set 1 - $1$ - - 1 - - - - false - - - import org.apache.commons.codec.binary.Base64; - -byte[] encodedBytes = Base64.encodeBase64("set_name=Attribute Set 1".getBytes()); -vars.put("attribute_set_filter", new String(encodedBytes)); - - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - 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()); - -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")); - -do { - number1 = random.nextInt(props.get("simple_products_list_for_edit").size()); -} while(number == number1); -simpleList = props.get("simple_products_list_for_edit").get(number1); -vars.put("simple_product_2_id", simpleList.get("id")); -vars.put("simple_product_2_name", simpleList.get("title")); - -number2 = random.nextInt(props.get("configurable_products_list").size()); -configurableList = props.get("configurable_products_list").get(number2); -vars.put("configurable_product_1_id", configurableList.get("id")); -vars.put("configurable_product_1_url_key", configurableList.get("url_key")); -vars.put("configurable_product_1_name", configurableList.get("title")); - -//Additional category to be added -//int categoryId = Integer.parseInt(vars.get("simple_product_category_id")); -//vars.put("category_additional", (categoryId+1).toString()); -//New price -vars.put("price_new", "9999"); -//New special price -vars.put("special_price_new", "8888"); -//New quantity -vars.put("quantity_new", "100600"); -vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNum}-${__Random(1,1000000)}"); - - - - - true - tool/fragments/ce/admin_create_product/setup.jmx - - - - tool/fragments/ce/admin_create_product/create_bundle_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/bundle/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 42 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[configurable_variations] - - - true - 1 - = - true - affect_configurable_product_attributes - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - new-variations-attribute-set-id - - - true - 0 - = - true - product[shipment_type] - - - true - option title one - = - true - bundle_options[bundle_options][0][title] - - - true - - = - true - bundle_options[bundle_options][0][option_id] - - - true - - = - true - bundle_options[bundle_options][0][delete] - - - true - select - = - true - bundle_options[bundle_options][0][type] - - - true - 1 - = - true - bundle_options[bundle_options][0][required] - - - true - 0 - = - true - bundle_options[bundle_options][0][position] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][option_id] - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][0][bundle_selections][0][product_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][delete] - - - true - 25 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_value] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_type] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty] - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][0][position] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][option_id] - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][0][bundle_selections][1][product_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][delete] - - - true - 10.99 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_value] - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_type] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][position] - - - true - option title two - = - true - bundle_options[bundle_options][1][title] - - - true - - = - true - bundle_options[bundle_options][1][option_id] - - - true - - = - true - bundle_options[bundle_options][1][delete] - - - true - select - = - true - bundle_options[bundle_options][1][type] - - - true - 1 - = - true - bundle_options[bundle_options][1][required] - - - true - 1 - = - true - bundle_options[bundle_options][1][position] - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][option_id] - true - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][1][bundle_selections][0][product_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][delete] - true - - - true - 5.00 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_value] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_type] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][position] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][option_id] - true - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][1][bundle_selections][1][product_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][delete] - true - - - true - 7.00 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_value] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_type] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][position] - true - - - true - 2 - = - true - affect_bundle_product_selections - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 42 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full bundle product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[configurable_variations] - - - true - 1 - = - true - affect_configurable_product_attributes - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - new-variations-attribute-set-id - - - true - 0 - = - true - product[shipment_type] - false - - - true - option title one - = - true - bundle_options[bundle_options][0][title] - false - - - true - - = - true - bundle_options[bundle_options][0][option_id] - false - - - true - - = - true - bundle_options[bundle_options][0][delete] - false - - - true - select - = - true - bundle_options[bundle_options][0][type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][required] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][position] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][option_id] - false - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][0][bundle_selections][0][product_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][delete] - false - - - true - 25 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_value] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][0][position] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][option_id] - false - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][0][bundle_selections][1][product_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][delete] - false - - - true - 10.99 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][position] - false - - - true - option title two - = - true - bundle_options[bundle_options][1][title] - false - - - true - - = - true - bundle_options[bundle_options][1][option_id] - false - - - true - - = - true - bundle_options[bundle_options][1][delete] - false - - - true - select - = - true - bundle_options[bundle_options][1][type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][required] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][position] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][option_id] - false - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][1][bundle_selections][0][product_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][delete] - false - - - true - 5.00 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][position] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][option_id] - false - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][1][bundle_selections][1][product_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][delete] - false - - - true - 7.00 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][position] - false - - - true - 2 - = - true - affect_bundle_product_selections - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/bundle/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - option title one - option title two - ${simple_product_2_name} - ${simple_product_1_name} - - - Assertion.response_data - false - 2 - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/open_catalog_grid.jmx - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/${attribute_set_id}/type/configurable/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/new_configurable.jmx - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - ${admin_form_key} - = - true - form_key - true - - - true - ${attribute_set_id} - = - true - new-variations-attribute-set-id - true - - - true - 1 - = - true - product[affect_product_custom_options] - true - - - true - ${attribute_set_id} - = - true - product[attribute_set_id] - true - - - true - 4 - = - true - product[category_ids][0] - true - - - true - - = - true - product[custom_layout_update] - true - - - true - - = - true - product[description] - true - - - true - 0 - = - true - product[gift_message_available] - true - - - true - 1 - = - true - product[gift_wrapping_available] - true - - - true - - = - true - product[gift_wrapping_price] - true - - - true - - = - true - product[image] - true - - - true - 2 - = - true - product[is_returnable] - true - - - true - ${configurable_sku} - Meta Description - = - true - product[meta_description] - true - - - true - ${configurable_sku} - Meta Keyword - = - true - product[meta_keyword] - true - - - true - ${configurable_sku} - Meta Title - = - true - product[meta_title] - true - - - true - ${configurable_sku} - = - true - product[name] - true - - - true - container2 - = - true - product[options_container] - true - - - true - ${price_new} - = - true - product[price] - true - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - true - - - true - 1000 - = - true - product[quantity_and_stock_status][qty] - true - - - true - - = - true - product[short_description] - true - - - true - ${configurable_sku} - = - true - product[sku] - true - - - true - - = - true - product[small_image] - true - - - true - ${special_price_new} - = - true - product[special_price] - true - - - true - 1 - = - true - product[status] - true - - - true - 0 - = - true - product[stock_data][backorders] - true - - - true - 1 - = - true - product[stock_data][deferred_stock_update] - true - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - true - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - true - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - true - - - true - 1 - = - true - product[stock_data][manage_stock] - true - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - true - - - true - 0 - = - true - product[stock_data][min_qty] - true - - - true - 1 - = - true - product[stock_data][min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_backorders] - true - - - true - 1 - = - true - product[stock_data][use_config_deferred_stock_update] - true - - - true - 1 - = - true - product[stock_data][use_config_enable_qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - true - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - true - - - true - 2 - = - true - product[tax_class_id] - true - - - true - - = - true - product[thumbnail] - true - - - true - - = - true - product[url_key] - true - - - true - 1 - = - true - product[use_config_gift_message_available] - true - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - true - - - true - 1 - = - true - product[use_config_is_returnable] - true - - - true - 4 - = - true - product[visibility] - true - - - true - 1 - = - true - product[website_ids][1] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/${attribute_set_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_validate.jmx - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - javascript - - - - -attributes = vars.getObject("product_attributes"); - -for (i in attributes) { - var attribute = attributes[i]; - sampler.addArgument("attribute_codes[" + i + "]", attribute.code); - sampler.addArgument("attributes[" + i + "]", attribute.id); - sampler.addArgument("product[" + attribute.code + "]", attribute.options[0].value); - addConfigurableAttributeData(attribute); -} - -addConfigurableMatrix(attributes); - -function addConfigurableAttributeData(attribute) { - var attributeId = attribute.id; - - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attribute.code); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attribute.label); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][position]", 0); - attribute.options.forEach(function (option, index) { - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][include]", index); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][value_index]", option.value); - }); -} - -/** - * Build 4 simple products for Configurable - */ -function addConfigurableMatrix(attributes) { - - var attribute1 = attributes[0], - attribute2 = attributes[1], - productIndex = 1, - products = []; - var variationNames = []; - attribute1.options.forEach(function (option1) { - attribute2.options.forEach(function (option2) { - var productAttributes = {}, - namePart = option1.label + "+" + option2.label, - variationKey = option1.value + "-" + option2.value; - productAttributes[attribute1.code] = option1.value; - productAttributes[attribute2.code] = option2.value; - - variationNames.push(namePart + " - " + vars.get("configurable_sku")); - var product = { - "id": null, - "name": namePart + " - " + vars.get("configurable_sku"), - "sku": namePart + " - " + vars.get("configurable_sku"), - "status": 1, - "price": "100", - "price_currency": "$", - "price_string": "$100", - "weight": "6", - "qty": "50", - "variationKey": variationKey, - "configurable_attribute": JSON.stringify(productAttributes), - "thumbnail_image": "", - "media_gallery": {"images": {}}, - "image": [], - "was_changed": true, - "canEdit": 1, - "newProduct": 1, - "record_id": productIndex - }; - productIndex++; - products.push(product); - }); - }); - - sampler.addArgument("configurable-matrix-serialized", JSON.stringify(products)); - vars.putObject("configurable_variations_assertion", variationNames); -} - - tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - ${admin_form_key} - = - true - form_key - true - - - true - ${attribute_set_id} - = - true - new-variations-attribute-set-id - true - - - true - 1 - = - true - product[affect_product_custom_options] - true - - - true - ${attribute_set_id} - = - true - product[attribute_set_id] - true - - - true - 2 - = - true - product[category_ids][0] - true - - - true - - = - true - product[custom_layout_update] - true - - - true - - = - true - product[description] - true - - - true - 0 - = - true - product[gift_message_available] - true - - - true - 1 - = - true - product[gift_wrapping_available] - true - - - true - - = - true - product[gift_wrapping_price] - true - - - true - - = - true - product[image] - true - - - true - 2 - = - true - product[is_returnable] - true - - - true - ${configurable_sku} - Meta Description - = - true - product[meta_description] - true - - - true - ${configurable_sku} - Meta Keyword - = - true - product[meta_keyword] - true - - - true - ${configurable_sku} - Meta Title - = - true - product[meta_title] - true - - - true - ${configurable_sku} - = - true - product[name] - true - - - true - container2 - = - true - product[options_container] - true - - - true - ${price_new} - = - true - product[price] - true - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - true - - - true - 1000 - = - true - product[quantity_and_stock_status][qty] - true - - - true - - = - true - product[short_description] - true - - - true - ${configurable_sku} - = - true - product[sku] - true - - - true - - = - true - product[small_image] - true - - - true - ${special_price_new} - = - true - product[special_price] - true - - - true - 1 - = - true - product[status] - true - - - true - 0 - = - true - product[stock_data][backorders] - true - - - true - 1 - = - true - product[stock_data][deferred_stock_update] - true - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - true - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - true - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - true - - - true - 1 - = - true - product[stock_data][manage_stock] - true - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - true - - - true - 0 - = - true - product[stock_data][min_qty] - true - - - true - 1 - = - true - product[stock_data][min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_backorders] - true - - - true - 1 - = - true - product[stock_data][use_config_deferred_stock_update] - true - - - true - 1 - = - true - product[stock_data][use_config_enable_qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - true - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - true - - - true - 2 - = - true - product[tax_class_id] - true - - - true - - = - true - product[thumbnail] - true - - - true - - = - true - product[url_key] - true - - - true - 1 - = - true - product[use_config_gift_message_available] - true - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - true - - - true - 1 - = - true - product[use_config_is_returnable] - true - - - true - 4 - = - true - product[visibility] - true - - - true - 1 - = - true - product[website_ids][1] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/${attribute_set_id}/type/configurable/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_save.jmx - - - - You saved the product - - Assertion.response_data - false - 2 - - - - javascript - - - - -var configurableVariations = vars.getObject("configurable_variations_assertion"), -response = SampleResult.getResponseDataAsString(); - -configurableVariations.forEach(function (variation) { - if (response.indexOf(variation) == -1) { - AssertionResult.setFailureMessage("Cannot find variation \"" + variation + "\""); - AssertionResult.setFailure(true); - } -}); - - - - - - javascript - - - - -attributes = vars.getObject("product_attributes"); - -for (i in attributes) { - var attribute = attributes[i]; - sampler.addArgument("attribute_codes[" + i + "]", attribute.code); - sampler.addArgument("attributes[" + i + "]", attribute.id); - sampler.addArgument("product[" + attribute.code + "]", attribute.options[0].value); - addConfigurableAttributeData(attribute); -} - -addConfigurableMatrix(attributes); - -function addConfigurableAttributeData(attribute) { - var attributeId = attribute.id; - - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attribute.code); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attribute.label); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][position]", 0); - attribute.options.forEach(function (option, index) { - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][include]", index); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][value_index]", option.value); - }); -} - -/** - * Build 4 simple products for Configurable - */ -function addConfigurableMatrix(attributes) { - - var attribute1 = attributes[0], - attribute2 = attributes[1], - productIndex = 1, - products = []; - var variationNames = []; - attribute1.options.forEach(function (option1) { - attribute2.options.forEach(function (option2) { - var productAttributes = {}, - namePart = option1.label + "+" + option2.label, - variationKey = option1.value + "-" + option2.value; - productAttributes[attribute1.code] = option1.value; - productAttributes[attribute2.code] = option2.value; - - variationNames.push(namePart + " - " + vars.get("configurable_sku")); - var product = { - "id": null, - "name": namePart + " - " + vars.get("configurable_sku"), - "sku": namePart + " - " + vars.get("configurable_sku"), - "status": 1, - "price": "100", - "price_currency": "$", - "price_string": "$100", - "weight": "6", - "qty": "50", - "variationKey": variationKey, - "configurable_attribute": JSON.stringify(productAttributes), - "thumbnail_image": "", - "media_gallery": {"images": {}}, - "image": [], - "was_changed": true, - "canEdit": 1, - "newProduct": 1, - "record_id": productIndex - }; - productIndex++; - products.push(product); - }); - }); - - sampler.addArgument("configurable-matrix-serialized", JSON.stringify(products)); - vars.putObject("configurable_variations_assertion", variationNames); -} - - tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx - - - - - - tool/fragments/ce/admin_create_product/create_downloadable_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/downloadable/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - ${files_folder}downloadable_original.txt - links - text/plain - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/downloadable_file/upload/type/links/?isAjax=true - POST - false - false - true - true - false - - - - - original_file - $.file - - - BODY - - - - - - - - ${files_folder}downloadable_sample.txt - samples - text/plain - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/downloadable_file/upload/type/samples/?isAjax=true - POST - false - false - true - true - false - - - - - sample_file - $.file - - - BODY - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - on - = - true - is_downloadable - - - true - Links - = - true - product[links_title] - - - true - 0 - = - true - product[links_purchased_separately] - - - true - ${original_file} - = - true - downloadable[link][0][file][0][file] - false - - - true - downloadable_original.txt - = - true - downloadable[link][0][file][0][name] - false - - - true - 13 - = - true - downloadable[link][0][file][0][size] - false - - - true - new - = - true - downloadable[link][0][file][0][status] - false - - - true - 1 - = - true - downloadable[link][0][is_shareable] - - - true - 0 - = - true - downloadable[link][0][is_unlimited] - - - true - - = - true - downloadable[link][0][link_url] - - - true - 0 - = - true - downloadable[link][0][number_of_downloads] - true - - - true - 120 - = - true - downloadable[link][0][price] - true - - - true - 0 - = - true - downloadable[link][0][record_id] - true - - - true - file - = - true - downloadable[link][0][sample][type] - - - true - - = - true - downloadable[link][0][sample][url] - - - true - 1 - = - true - downloadable[link][0][sort_order] - - - true - Original Link - = - true - downloadable[link][0][title] - - - true - file - = - true - downloadable[link][0][type] - - - true - ${sample_file} - = - true - downloadable[sample][0][file][0][file] - true - - - true - downloadable_sample.txt - = - true - downloadable[sample][0][file][0][name] - true - - - true - 14 - = - true - downloadable[sample][0][file][0][size] - true - - - true - new - = - true - downloadable[sample][0][file][0][status] - true - - - true - 0 - = - true - downloadable[sample][0][record_id] - true - - - true - - = - true - downloadable[sample][0][sample_url] - true - - - true - 1 - = - true - downloadable[sample][0][sort_order] - true - - - true - Sample Link - = - true - downloadable[sample][0][title] - true - - - true - file - = - true - downloadable[sample][0][type] - true - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - 4 - = - true - new-variations-attribute-set-id - false - - - true - - = - true - product[configurable_variation] - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/type/downloadable/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - false - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - ${original_file} - = - true - downloadable[link][0][file][0][file] - false - - - true - downloadable_original.txt - = - true - downloadable[link][0][file][0][name] - false - - - true - 13 - = - true - downloadable[link][0][file][0][size] - false - - - true - new - = - true - downloadable[link][0][file][0][status] - false - - - true - 1 - = - true - downloadable[link][0][is_shareable] - true - - - true - 0 - = - true - downloadable[link][0][is_unlimited] - true - - - true - - = - true - downloadable[link][0][link_url] - true - - - true - 0 - = - true - downloadable[link][0][number_of_downloads] - false - - - true - 120 - = - true - downloadable[link][0][price] - false - - - true - 0 - = - true - downloadable[link][0][record_id] - false - - - true - file - = - true - downloadable[link][0][sample][type] - true - - - true - - = - true - downloadable[link][0][sample][url] - true - - - true - 1 - = - true - downloadable[link][0][sort_order] - true - - - true - Original Link - = - true - downloadable[link][0][title] - true - - - true - file - = - true - downloadable[link][0][type] - true - - - true - ${sample_file} - = - true - downloadable[sample][0][file][0][file] - true - - - true - downloadable_sample.txt - = - true - downloadable[sample][0][file][0][name] - true - - - true - 14 - = - true - downloadable[sample][0][file][0][size] - true - - - true - new - = - true - downloadable[sample][0][file][0][status] - true - - - true - 0 - = - true - downloadable[sample][0][record_id] - true - - - true - - = - true - downloadable[sample][0][sample_url] - true - - - true - 1 - = - true - downloadable[sample][0][sort_order] - true - - - true - Sample Link - = - true - downloadable[sample][0][title] - true - - - true - file - = - true - downloadable[sample][0][type] - true - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - 4 - = - true - new-variations-attribute-set-id - false - - - true - - = - true - product[configurable_variation] - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/downloadable/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - violation - - Assertion.response_data - false - 6 - - - - - - - tool/fragments/ce/admin_create_product/create_simple_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/simple/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - product[options][1][is_delete] - false - - - true - 1 - = - true - product[options][1][is_require] - false - - - true - select - = - true - product[options][1][previous_group] - false - - - true - drop_down - = - true - product[options][1][previous_type] - false - - - true - 0 - = - true - product[options][1][sort_order] - false - - - true - Product Option Title One - = - true - product[options][1][title] - false - - - true - drop_down - = - true - product[options][1][type] - false - - - true - - = - true - product[options][1][values][1][is_delete] - false - - - true - 200 - = - true - product[options][1][values][1][price] - false - - - true - fixed - = - true - product[options][1][values][1][price_type] - false - - - true - sku-one - = - true - product[options][1][values][1][sku] - false - - - true - 0 - = - true - product[options][1][values][1][sort_order] - false - - - true - Row Title - = - true - product[options][1][values][1][title] - false - - - true - - = - true - product[options][2][is_delete] - false - - - true - 1 - = - true - product[options][2][is_require] - false - - - true - 250 - = - true - product[options][2][max_characters] - false - - - true - text - = - true - product[options][2][previous_group] - false - - - true - field - = - true - product[options][2][previous_type] - false - - - true - 500 - = - true - product[options][2][price] - false - - - true - fixed - = - true - product[options][2][price_type] - false - - - true - sku-two - = - true - product[options][2][sku] - false - - - true - 1 - = - true - product[options][2][sort_order] - false - - - true - Field Title - = - true - product[options][2][title] - false - - - true - field - = - true - product[options][2][type] - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - 4 - = - true - new-variations-attribute-set-id - true - - - true - - = - true - product[configurable_variation] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full simple product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - product[options][1][is_delete] - true - - - true - 1 - = - true - product[options][1][is_require] - - - true - select - = - true - product[options][1][previous_group] - false - - - true - drop_down - = - true - product[options][1][previous_type] - false - - - true - 0 - = - true - product[options][1][sort_order] - false - - - true - Product Option Title One - = - true - product[options][1][title] - - - true - drop_down - = - true - product[options][1][type] - - - true - - = - true - product[options][1][values][1][is_delete] - false - - - true - 200 - = - true - product[options][1][values][1][price] - - - true - fixed - = - true - product[options][1][values][1][price_type] - - - true - sku-one - = - true - product[options][1][values][1][sku] - - - true - 0 - = - true - product[options][1][values][1][sort_order] - - - true - Row Title - = - true - product[options][1][values][1][title] - - - true - - = - true - product[options][2][is_delete] - false - - - true - 1 - = - true - product[options][2][is_require] - - - true - 250 - = - true - product[options][2][max_characters] - - - true - text - = - true - product[options][2][previous_group] - - - true - field - = - true - product[options][2][previous_type] - - - true - 500 - = - true - product[options][2][price] - - - true - fixed - = - true - product[options][2][price_type] - - - true - sku-two - = - true - product[options][2][sku] - - - true - 1 - = - true - product[options][2][sort_order] - - - true - Field Title - = - true - product[options][2][title] - - - true - field - = - true - product[options][2][type] - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - 4 - = - true - new-variations-attribute-set-id - true - - - true - - = - true - product[configurable_variation] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/simple/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - violation - - Assertion.response_data - false - 6 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${adminProductEditingPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Admin Edit Product"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.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) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - simpleCount = props.get("simple_products_list_for_edit").size(); - configCount = props.get("configurable_products_list_for_edit").size(); - productCount = 0; - if (simpleCount > configCount) { - productCount = configCount; - } else { - productCount = simpleCount; - } - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - threadsNumber = 1; - } - //Current thread number starts from 0 - currentThreadNum = ctx.getThreadNum(); - - String siterator = vars.get("threadIterator_" + currentThreadNum.toString()); - iterator = 0; - if(siterator == null){ - vars.put("threadIterator_" + currentThreadNum.toString() , "0"); - } else { - iterator = Integer.parseInt(siterator); - iterator ++; - vars.put("threadIterator_" + currentThreadNum.toString() , iterator.toString()); - } - - //Number of products for one thread - productClusterLength = productCount / threadsNumber; - - if (iterator >= productClusterLength) { - vars.put("threadIterator_" + currentThreadNum.toString(), "0"); - iterator = 0; - } - - //Index of the current product from the cluster - i = productClusterLength * currentThreadNum + iterator; - - //ids of simple and configurable products to edit - vars.put("simple_product_id", props.get("simple_products_list_for_edit").get(i).get("id")); - vars.put("configurable_product_id", props.get("configurable_products_list_for_edit").get(i).get("id")); - - //id of related product - do { - relatedIndex = random.nextInt(props.get("simple_products_list_for_edit").size()); - } while(i == relatedIndex); - vars.put("related_product_id", props.get("simple_products_list_for_edit").get(relatedIndex).get("id")); - } catch (Exception ex) { - log.info("Script execution failed", ex); -} - - - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/edit/id/${simple_product_id}/ - GET - true - false - true - false - false - - - - - - Product - - Assertion.response_data - false - 16 - - - - false - simple_product_name - ,"name":"([^'"]+)", - $1$ - - 1 - - - - false - simple_product_sku - ,"sku":"([^'"]+)", - $1$ - - 1 - - - - false - simple_product_category_id - ,"category_ids":."(\d+)". - $1$ - - 1 - - - - - Passing arguments between threads - //Additional category to be added - import java.util.Random; - - Random randomGenerator = new Random(); - int newCategoryId; - if (${seedForRandom} > 0) { - randomGenerator.setSeed(${seedForRandom} + ${__threadNum}); - } - - int categoryId = Integer.parseInt(vars.get("simple_product_category_id")); - categoryList = props.get("admin_category_ids_list"); - - if (categoryList.size() > 1) { - do { - int index = randomGenerator.nextInt(categoryList.size()); - newCategoryId = Integer.parseInt(categoryList.get(index)); - } while (categoryId == newCategoryId); - - vars.put("category_additional", newCategoryId.toString()); - } - - //New price - vars.put("price_new", "9999"); - //New special price - vars.put("special_price_new", "8888"); - //New quantity - vars.put("quantity_new", "100600"); - - - - false - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${simple_product_name} - = - true - product[name] - false - - - true - ${simple_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - ${quantity_new} - = - true - product[quantity_and_stock_status][qty] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 1.0000 - = - true - product[weight] - false - - - true - 1 - = - true - product[product_has_weight] - false - - - true - ${simple_product_category_id} - = - true - product[category_ids][] - false - - - true - <p>Full simple product Description ${simple_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - - = - true - product[configurable_variations] - false - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - - = - true - product[image] - false - - - true - - = - true - product[small_image] - false - - - true - - = - true - product[thumbnail] - false - - - true - ${simple_product_name} - = - true - product[url_key] - false - - - true - ${simple_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${simple_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${simple_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - ${quantity_new} - = - true - product[stock_data][original_inventory_qty] - false - - - true - ${quantity_new} - = - true - product[stock_data][qty] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - - = - true - new-variations-attribute-set-id - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/id/${simple_product_id}/?isAjax=true - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${simple_product_name} - = - true - product[name] - false - - - true - ${simple_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - ${quantity_new} - = - true - product[quantity_and_stock_status][qty] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 1.0000 - = - true - product[weight] - false - - - true - 1 - = - true - product[product_has_weight] - false - - - true - ${simple_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - - - true - <p>Full simple product Description ${simple_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - - = - true - product[configurable_variations] - false - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - - = - true - product[image] - false - - - true - - = - true - product[small_image] - false - - - true - - = - true - product[thumbnail] - false - - - true - ${simple_product_name} - = - true - product[url_key] - false - - - true - ${simple_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${simple_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${simple_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - ${quantity_new} - = - true - product[stock_data][original_inventory_qty] - false - - - true - ${quantity_new} - = - true - product[stock_data][qty] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - - = - true - new-variations-attribute-set-id - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/id/${simple_product_id}/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/edit/id/${configurable_product_id}/ - GET - true - false - true - false - false - - - - - - Product - - Assertion.response_data - false - 16 - - - - false - configurable_product_name - ,"name":"([^'"]+)", - $1$ - - 1 - - - - false - configurable_product_sku - ,"sku":"([^'"]+)", - $1$ - - 1 - - - - false - configurable_product_category_id - ,"category_ids":."(\d+)" - $1$ - - 1 - - - - false - configurable_attribute_id - ,"configurable_variation":"([^'"]+)", - $1$ - - 1 - true - - - - false - configurable_matrix - "configurable-matrix":(\[.*?\]) - $1$ - - 1 - true - - - - associated_products_ids - $.[*].id - - configurable_matrix - VAR - - - - false - configurable_product_data - (\{"product":.*?configurable_attributes_data.*?\})\s*< - $1$ - - 1 - - - - configurable_attributes_data - $.product.configurable_attributes_data - - configurable_product_data - VAR - - - - false - configurable_attribute_ids - "attribute_id":"(\d+)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_codes - "code":"(\w+)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_labels - "label":"(.*?)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_values - "values":(\{(?:\}|.*?\}\})) - $1$ - - -1 - variable - configurable_attributes_data - - - - - configurable_attribute_ids - configurable_attribute_id - true - - - - 1 - ${configurable_attribute_ids_matchNr} - 1 - attribute_counter - - true - true - - - - return vars.get("configurable_attribute_values_" + vars.get("attribute_counter")); - - - false - - - - false - attribute_${configurable_attribute_id}_values - "value_index":"(\d+)" - $1$ - - -1 - configurable_attribute_values_${attribute_counter} - - - - - - - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${configurable_product_name} - = - true - product[name] - false - - - true - ${configurable_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 3 - = - true - product[weight] - false - - - true - ${configurable_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - false - - - true - <p>Configurable product description ${configurable_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - ${configurable_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${configurable_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${configurable_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - ${configurable_attribute_id} - = - true - product[configurable_variation] - false - - - true - ${configurable_product_name} - = - true - product[url_key] - - - true - 1 - = - true - product[use_config_gift_message_available] - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - - - true - 4 - = - true - product[visibility] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 50 - = - true - product[stock_data][qty] - false - - - true - configurable - = - true - product[stock_data][type_id] - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/id/${configurable_product_id}/ - POST - true - false - true - false - false - - - - - false - - - try { - int attributesCount = Integer.parseInt(vars.get("configurable_attribute_ids_matchNr")); - for (int i = 1; i <= attributesCount; i++) { - attributeId = vars.get("configurable_attribute_ids_" + i.toString()); - attributeCode = vars.get("configurable_attribute_codes_" + i.toString()); - attributeLabel = vars.get("configurable_attribute_labels_" + i.toString()); - ctx.getCurrentSampler().addArgument("attributes[" + (i - 1).toString() + "]", attributeId); - ctx.getCurrentSampler().addArgument("attribute_codes[" + (i - 1).toString() + "]", attributeCode); - ctx.getCurrentSampler().addArgument("product[" + attributeCode + "]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][position]", (i - 1).toString()); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attributeCode); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attributeLabel); - - int valuesCount = Integer.parseInt(vars.get("attribute_" + attributeId + "_values_matchNr")); - for (int j = 1; j <= valuesCount; j++) { - attributeValue = vars.get("attribute_" + attributeId + "_values_" + j.toString()); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][include]", - "1" - ); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][value_index]", - attributeValue - ); - } - } - ctx.getCurrentSampler().addArgument("associated_product_ids_serialized", vars.get("associated_products_ids").toString()); - } catch (Exception e) { - log.error("error???", e); - } - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${configurable_product_name} - = - true - product[name] - false - - - true - ${configurable_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id]admin - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 3 - = - true - product[weight] - false - - - true - ${configurable_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - false - - - true - <p>Configurable product description ${configurable_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - ${configurable_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${configurable_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${configurable_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - ${configurable_attribute_id} - = - true - product[configurable_variation] - false - - - true - ${configurable_product_name} - = - true - product[url_key] - - - true - 1 - = - true - product[use_config_gift_message_available] - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - - - true - 4 - = - true - product[visibility] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 50 - = - true - product[stock_data][qty] - false - - - true - configurable - = - true - product[stock_data][type_id] - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/id/${configurable_product_id}/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - false - - - try { - int attributesCount = Integer.parseInt(vars.get("configurable_attribute_ids_matchNr")); - for (int i = 1; i <= attributesCount; i++) { - attributeId = vars.get("configurable_attribute_ids_" + i.toString()); - attributeCode = vars.get("configurable_attribute_codes_" + i.toString()); - attributeLabel = vars.get("configurable_attribute_labels_" + i.toString()); - ctx.getCurrentSampler().addArgument("attributes[" + (i - 1).toString() + "]", attributeId); - ctx.getCurrentSampler().addArgument("attribute_codes[" + (i - 1).toString() + "]", attributeCode); - ctx.getCurrentSampler().addArgument("product[" + attributeCode + "]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][position]", (i - 1).toString()); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attributeCode); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attributeLabel); - - int valuesCount = Integer.parseInt(vars.get("attribute_" + attributeId + "_values_matchNr")); - for (int j = 1; j <= valuesCount; j++) { - attributeValue = vars.get("attribute_" + attributeId + "_values_" + j.toString()); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][include]", - "1" - ); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][value_index]", - attributeValue - ); - } - } - ctx.getCurrentSampler().addArgument("associated_product_ids_serialized", vars.get("associated_products_ids").toString()); - } catch (Exception e) { - log.error("error???", e); - } - - - - - You saved the product - - Assertion.response_data - false - 2 - if have trouble see messages-message-error - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - - - continue - - false - ${loops} - - ${csrPoolUsers} - ${ramp_period} - 1505803944000 - 1505803944000 - false - - - tool/fragments/_system/thread_group.jmx - - - 1 - false - 1 - ${adminReturnsManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Admin Returns Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/orders_page.jmx - - - - Create New Order - - Assertion.response_data - false - 2 - - - - - - - - - true - sales_order_grid - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 200 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - increment_id - = - true - sorting[field] - - - true - desc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - false - - - true - pending - = - true - filters[status] - true - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - sales_order_grid - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - 200 - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - increment_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - true - pending - = - true - filters[status] - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/search_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - false - order_numbers - \"increment_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - false - order_ids - \"entity_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - - - tool/fragments/ce/admin_create_process_returns/setup.jmx - - import java.util.ArrayList; - import java.util.HashMap; - import org.apache.jmeter.protocol.http.util.Base64Encoder; - import java.util.Random; - - // get count of "order_numbers" variable defined in "Search Pending Orders Limit" - int ordersCount = Integer.parseInt(vars.get("order_numbers_matchNr")); - - - int clusterLength; - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - //Number of orders for one thread - clusterLength = ordersCount; - } else { - clusterLength = Math.round(ordersCount / threadsNumber); - if (clusterLength == 0) { - clusterLength = 1; - } - } - - //Current thread number starts from 0 - int currentThreadNum = ctx.getThreadNum(); - - //Index of the current product from the cluster - Random random = new Random(); - if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - int iterator = random.nextInt(clusterLength); - if (iterator == 0) { - iterator = 1; - } - - int i = clusterLength * currentThreadNum + iterator; - - orderNumber = vars.get("order_numbers_" + i.toString()); - orderId = vars.get("order_ids_" + i.toString()); - vars.put("order_number", orderNumber); - vars.put("order_id", orderId); - - - - - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/view/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_order.jmx - - - - #${order_number} - - Assertion.response_data - false - 2 - - - - false - order_status - <span id="order_status">([^<]+)</span> - $1$ - - 1 - simple_products - - - - - - "${order_status}" == "Pending" - false - tool/fragments/ce/admin_edit_order/if_controller.jmx - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_start.jmx - - - - Invoice Totals - - Assertion.response_data - false - 2 - - - - false - item_ids - <div id="order_item_(\d+)_title"\s*class="product-title"> - $1$ - - -1 - simple_products - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - invoice[items][${item_ids_1}] - - - true - 1 - = - true - invoice[items][${item_ids_2}] - - - true - Invoiced - = - true - invoice[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx - - - - The invoice has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_creditmemo/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx - - - - New Memo - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - creditmemo[items][${item_ids_1}][qty] - - - true - 1 - = - true - creditmemo[items][${item_ids_2}][qty] - - - true - 1 - = - true - creditmemo[do_offline] - - - true - Credit Memo added - = - true - creditmemo[comment_text] - - - true - 10 - = - true - creditmemo[shipping_amount] - - - true - 0 - = - true - creditmemo[adjustment_positive] - - - true - 0 - = - true - creditmemo[adjustment_negative] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_creditmemo/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx - - - - You created the credit memo - - Assertion.response_data - false - 2 - - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))} - tool/fragments/ce/admin_create_process_returns/pause.jmx - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${browseCustomerGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Browse Customer Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Customer"); - - pagesCount = parseInt(vars.get("customers_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "customer_listing"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_customer_filter_text")); - vars.put("grid_filter_field", "name"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "name"); - vars.put("grid_sort_field_2", "group_id"); - vars.put("grid_sort_field_3", "billing_country_id"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_customers_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${adminCreateOrderPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Admin Create Order"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.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(); - -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); -simpleList = props.get("simple_products_list").get(number1); -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")); - - -customers_index = 0; -if (!props.containsKey("customer_ids_index")) { - props.put("customer_ids_index", customers_index); -} - -try { - customers_index = props.get("customer_ids_index"); - customers_list = props.get("customer_ids_list"); - - if (customers_index == customers_list.size()) { - customers_index=0; - } - vars.put("customer_id", customers_list.get(customers_index)); - props.put("customer_ids_index", ++customers_index); -} -catch (java.lang.Exception e) { - log.error("Caught Exception in 'Admin Create Order' thread."); - SampleResult.setStopThread(true); -} - - - true - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/start/ - GET - true - false - true - false - false - - Detected the start of a redirect chain - - - - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${configurable_product_1_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - true - item[${simple_product_1_id}][qty] - 1 - = - true - - - true - item[${simple_product_2_id}][qty] - 1 - = - true - - - true - item[${configurable_product_1_id}][qty] - 1 - = - true - - - true - customer_id - ${customer_id} - = - true - - - true - store_id - 1 - = - true - - - true - currency_id - - = - true - - - true - form_key - ${admin_form_key} - = - true - - - true - payment[method] - checkmo - = - true - - - true - reset_shipping - 1 - = - true - - - true - json - 1 - = - true - - - true - as_js_varname - iFrameResponse - = - true - - - true - form_key - ${admin_form_key} - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/loadBlock/block/search,items,shipping_method,totals,giftmessage,billing_method?isAjax=true - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - false - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - - ctx.getCurrentSampler().addArgument("item[" + vars.get("configurable_product_1_id") + "][super_attribute][" + attribute_ids_array[i] + "]", option_values_array[i]); - } -} catch (Exception e) { - log.error("error???", e); -} - - - - - - - - true - collect_shipping_rates - 1 - = - true - - - true - customer_id - ${customer_id} - = - true - - - true - store_id - 1 - = - true - - - true - currency_id - false - = - true - - - true - form_key - ${admin_form_key} - = - true - - - true - payment[method] - checkmo - = - true - - - true - json - true - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/loadBlock/block/shipping_method,totals?isAjax=true - POST - true - false - true - false - false - - - - - - shipping_method - Flat Rate - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/index/ - GET - true - false - true - false - false - - Detected the start of a redirect chain - - - - - Select from existing customer addresses - Submit Order - Items Ordered - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - limit - 20 - = - true - - - true - entity_id - - = - true - - - true - name - - = - true - - - true - email - - = - true - - - true - Telephone - - = - true - - - true - billing_postcode - - = - true - - - true - billing_country_id - - = - true - - - true - billing_regione - - = - true - - - true - store_name - - = - true - - - true - page - 1 - = - true - - - true - order[currency] - USD - = - true - - - true - sku - - = - true - - - true - qty - - = - true - - - true - limit - 20 - = - true - - - true - entity_id - - = - true - - - true - name - - = - true - - - true - sku - - = - true - - - true - price[from] - - = - true - - - true - price[to] - - = - true - - - true - in_products - - = - true - - - true - page - 1 - = - true - - - true - coupon_code - - = - true - - - true - order[account][group_id] - 1 - = - true - - - true - order[account][email] - user_${customer_id}@example.com - = - true - - - true - order[billing_address][customer_address_id] - - = - true - - - true - order[billing_address][prefix] - - = - true - - - true - order[billing_address][firstname] - Anthony - = - true - - - true - order[billing_address][middlename] - - = - true - - - true - order[billing_address][lastname] - Nealy - = - true - - - true - order[billing_address][suffix] - - = - true - - - true - order[billing_address][company] - - = - true - - - true - order[billing_address][street][0] - 123 Freedom Blvd. #123 - = - true - - - true - order[billing_address][street][1] - - = - true - - - true - order[billing_address][city] - Fayetteville - = - true - - - true - order[billing_address][country_id] - US - = - true - - - true - order[billing_address][region] - - = - true - - - true - order[billing_address][region_id] - ${alabama_region_id} - = - true - - - true - order[billing_address][postcode] - 123123 - = - true - - - true - order[billing_address][telephone] - 022-333-4455 - = - true - - - true - order[billing_address][fax] - - = - true - - - true - order[billing_address][vat_id] - - = - true - - - true - shipping_same_as_billing - on - = - true - - - true - payment[method] - checkmo - = - true - - - true - order[shipping_method] - flatrate_flatrate - = - true - - - true - order[comment][customer_note] - - = - true - - - true - order[comment][customer_note_notify] - 1 - = - true - - - true - order[send_confirmation] - 1 - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/save/ - POST - true - false - true - true - false - - Detected the start of a redirect chain - - - - false - order_id - ${host}${base_path}${admin_path}/sales/order/index/order_id/(\d+)/ - $1$ - - 1 - - - - false - order_item_1 - order_item_(\d+)_title - $1$ - - 1 - - - - false - order_item_2 - order_item_(\d+)_title - $1$ - - 2 - - - - false - order_item_3 - order_item_(\d+)_title - $1$ - - 3 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_2 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_3 - - - - - You created the order. - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - invoice[items][${order_item_1}] - 1 - = - true - - - true - invoice[items][${order_item_2}] - 1 - = - true - - - true - invoice[items][${order_item_3}] - 1 - = - true - - - true - invoice[comment_text] - - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - - The invoice has been created. - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - shipment[items][${order_item_1}] - 1 - = - true - - - true - shipment[items][${order_item_2}] - 1 - = - true - - - true - shipment[items][${order_item_3}] - 1 - = - true - - - true - shipment[comment_text] - - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/ - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - - The shipment has been created. - - Assertion.response_data - false - 2 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - - - continue - - false - ${loops} - - ${apiPoolUsers} - ${ramp_period} - 1505803944000 - 1505803944000 - false - - - tool/fragments/_system/thread_group.jmx - - - 1 - false - 1 - ${apiBasePercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "API"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - 1 - false - 1 - 100 - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "API Create Customer"); - - true - - - - - true - - - - false - { - "customer": { - - "email": "customer_${__time()}-${__threadNum}-${__Random(1,1000000)}@example.com", - "firstname": "test_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "lastname": "Doe" - }, - "password": "test@123" -} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/customers - POST - true - false - true - false - false - - tool/fragments/ce/api/create_customer.jmx - - - customer_id - $.id - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - customer_id - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/customers/${customer_id} - GET - true - false - true - false - false - - tool/fragments/ce/api/check_customer.jmx - - - $.id - ${customer_id} - true - false - false - - - - - - - - 1 - false - 1 - 100 - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "API Catalog Browsing"); - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/categories - GET - true - false - true - false - false - - tool/fragments/ce/api/get_categories.jmx - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - search_category_id - $.id - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - search_category_id - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/categories/${search_category_id} - GET - true - false - true - false - false - - tool/fragments/ce/api/get_category.jmx - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - 20 - = - true - searchCriteria[page_size] - true - - - true - 1 - = - true - searchCriteria[current_page] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_products.jmx - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - 1 - false - 1 - 100 - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "API Search"); - - true - - - - - - - - true - quick_search_container - = - true - searchCriteria[request_name] - - - true - search_term - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - Simple - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - 20 - = - true - searchCriteria[page_size] - - - true - 1 - = - true - searchCriteria[current_page] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/search - GET - true - false - true - false - false - - tool/fragments/ce/api/search_for_product_frontend.jmx - - - $.total_count - 0 - true - false - true - - - - search_product_id - $.items[0].id - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - search_product_id - - - - - - - - 1 - false - 1 - 100 - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "API Checkout"); - - true - - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts - POST - true - false - true - false - false - - tool/fragments/ce/api/create_quote.jmx - - - quote_id - $ - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - quote_id - - - - - - true - - - - false - { - "cartItem": { - "sku": "${product_sku}", - "qty":"1", - "quote_id":"${quote_id}" - } -} - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/${quote_id}/items - POST - true - false - true - false - false - - tool/fragments/ce/api/add_product_to_quote_hardwired_sku.jmx - - - - $.sku - ${product_sku} - true - false - false - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/${quote_id}/items - GET - true - false - true - false - false - - tool/fragments/ce/api/check_product_in_quote_hardwired_sku.jmx - - - $[0].sku - ${product_sku} - true - false - false - - - - - - true - - - - false - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/ - POST - true - false - true - false - false - - tool/fragments/ce/api/create_guest_cart.jmx - - - cart_id - $ - - - BODY - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - - - true - - - - false - { - "cartItem": { - "sku": "${product_sku}", - "qty":"1", - "quote_id":"${cart_id}" - } -} - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/items - POST - true - false - true - false - false - - tool/fragments/ce/api/add_product_to_guest_cart_hardwired_sku.jmx - - - $.quote_id - ^[a-z0-9-]+$ - true - false - false - - - - - - true - - - - false - { - "sender": "John Doe", - "recipient": "Jane Roe", - "giftMessage": "Gift Message Text" -} - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/gift-message - POST - true - false - true - false - false - - tool/fragments/ce/api/add_gift_message_to_guest_cart.jmx - - - $ - true - true - false - false - - - - - - true - - - - false - {"address":{"country_id":"US","postcode":"95630"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/estimate-shipping-methods - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "available":true - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"addressInformation":{"shipping_address":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"},"shipping_method_code":"flatrate","shipping_carrier_code":"flatrate"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/shipping-information - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - {"payment_methods": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"cartId":"${cart_id}","email":"test@example.com","paymentMethod":{"method":"checkmo","po_number":null,"additional_data":null},"billingAddress":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname","save_in_address_book":0}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/payment-information - POST - true - false - true - false - false - - tool/fragments/ce/api/checkout_payment_info_place_order.jmx - - - - "[0-9]+" - - Assertion.response_data - false - 2 - - - - order_id - $ - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - - - - 1 - false - 1 - 100 - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "API Product Management"); - - true - - - - - true - - - - false - { - "product": { - "sku": "psku-test-${__time()}-${__threadNum}-${__Random(1,1000000)}", - "name": "Product_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "attributeSetId": 4 - } -} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products - POST - true - false - true - false - false - - tool/fragments/ce/api/create_product_no_custom_attributes.jmx - - - simple_product_id - $.id - - - BODY - - - - simple_product_sku - $.sku - - - BODY - - - - simple_stock_item_id - $.extension_attributes.stock_item.item_id - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - simple_product_id - - - - - ^[a-z0-9-]+$ - - Assertion.response_data - false - 1 - variable - simple_product_sku - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - simple_stock_item_id - - - - - - true - - - - false - { - "stock_item": { - "manage_stock": 1, - "is_in_stock": 1, - "qty": ${simple_product_id} - } - } - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/${simple_product_sku}/stockItems/${simple_stock_item_id} - PUT - true - false - true - false - false - - tool/fragments/ce/api/update_product_stock_info.jmx - - - $ - ${simple_stock_item_id} - true - false - false - - - - - - true - - - - true - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/${simple_product_sku} - GET - true - false - true - false - false - - tool/fragments/ce/api/check_product.jmx - - - $.sku - ${simple_product_sku} - true - false - false - - - - $.id - ${simple_product_id} - true - false - false - - - - $.extension_attributes.stock_item.item_id - ${simple_stock_item_id} - true - false - false - - - - $.extension_attributes.stock_item.qty - ${simple_product_id} - true - false - false - - - - - - true - - - - false - { - "product": { - "sku": "apsku-test-${__time()}-${__threadNum}-${__Random(1,1000000)}", - "name": "Extensible_Product_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "visibility": "4", - "type_id": "simple", - "price": "3.62", - "status": "1", - "attribute_set_id": "4", - "custom_attributes": [ - { - "attribute_code": "cost", - "value": "" - }, - { - "attribute_code": "description", - "value": "Description" - } - ], - "extension_attributes":{ - "stock_item":{ - "manage_stock": 1, - "is_in_stock": 1, - "qty":"100" - } - } , - "media_gallery_entries": - [{ - "id": null, - "label":"test_label_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "position":1, - "disabled":0, - "media_type":"image", - "types":["image"], - "content":{ - "base64_encoded_data": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABgAGADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+iioLy8t9Ps5bu7lWKCIZd26KKaTbshpX0RPRXN/8J/4V/6DVv8Ak3+FH/Cf+Ff+g1b/AJN/hXR9SxP/AD7l9zNPYVf5X9x0lFc3/wAJ/wCFf+g1b/k3+FH/AAn/AIV/6DVv+Tf4UfUsT/z7l9zD2FX+V/cdJRXN/wDCf+Ff+g1b/k3+FH/Cf+Ff+g1b/k3+FH1LE/8APuX3MPYVf5X9x0lFc3/wn/hX/oNW/wCTf4Uf8J/4V/6DVv8Ak3+FH1LE/wDPuX3MPYVf5X9x0lFVdP1G01WyS8sZ1nt3JCyL0ODg/qKtVzyi4u0lZmbTTswrm/H3/Iiav/1x/wDZhXSVzfj7/kRNX/64/wDswrowf+80/wDEvzNKH8WPqj5voorB1zS7OLT7m7SHE5YNu3HqWGeM471+kYutOhSdSEU7Jt3dtF20f6H1FacqcHJK9vO36M3qKzTa6foqPdxwlWxswrFi2T0AJ9aRdVmjkT7XYSW8TsFEm8MAT0yB0qfrcafu1tJeV2l2u7K3zsL2yjpPR+V3+NjTorPn1GVbt7a1s2uJIwDJ84ULnpyaik1SWTTrp47Z0uIQRJGzAFOPvZ70Sx1GLau9L9H03SdrNrsgdeCuu3k+hq0VR0ma4msImuIih2LtYvuLjA+b2zV6uijUVWmprqaQkpxUl1PoP4Xf8iBYf78v/oxq7GuO+F3/ACIFh/vy/wDoxq7GvzTMf98q/wCJ/mfLYn+NP1YVzfj7/kRNX/64/wDswrpK5vx9/wAiJq//AFx/9mFRg/8Aeaf+JfmTQ/ix9UfN9ZniD/kB3H/Af/QhWnTZI45kKSIroeqsMg1+l4mk61GdNfaTX3o+pqw54Sj3Rma/GXsI3BcLFMruU+8F5yR+dUZ4tOeNFOq3tx5jACNZg5J+mK6PrUMdrbxPvjgiR/7yoAa48TgPa1HNW1STvfp2s1+JjVw/PJy017mbe/YTqTB7iWzuQgPmhtocfjwajiupbjTtTieUXCxRsqTKMb8qePwrYlghnAE0UcgHQOoP86ckaRoERFVR/CowKbwU3UclJJO+19brqr203vvoHsJczd7J3/H8PmVNJnhm063WOVHZIkDhTkqcd/yNXajighg3eTFHHu67FAz+VSV2UIShTjGe67G9NOMUpbn0H8Lv+RAsP9+X/wBGNXY1x3wu/wCRAsP9+X/0Y1djX5tmP++Vf8T/ADPl8T/Gn6sK5vx9/wAiJq//AFx/9mFdJXN+Pv8AkRNX/wCuP/swqMH/ALzT/wAS/Mmh/Fj6o+b6KKK/Uj60KKKKACiiigAooooA+g/hd/yIFh/vy/8Aoxq7GuO+F3/IgWH+/L/6Mauxr8wzH/fKv+J/mfKYn+NP1YVzfj7/AJETV/8Arj/7MK6Sub8ff8iJq/8A1x/9mFRg/wDeaf8AiX5k0P4sfVHzfRRRX6kfWhRRRQAUUUUAFFFFAH0H8Lv+RAsP9+X/ANGNXY1x3wu/5ECw/wB+X/0Y1djX5hmP++Vf8T/M+UxP8afqwqC8s7fULOW0u4llglGHRujCp6K5E2ndGKdtUc3/AMIB4V/6Atv+bf40f8IB4V/6Atv+bf410lFdH13E/wDPyX3s09vV/mf3nN/8IB4V/wCgLb/m3+NH/CAeFf8AoC2/5t/jXSUUfXcT/wA/Jfew9vV/mf3nN/8ACAeFf+gLb/m3+NH/AAgHhX/oC2/5t/jXSUUfXcT/AM/Jfew9vV/mf3nN/wDCAeFf+gLb/m3+NH/CAeFf+gLb/m3+NdJRR9dxP/PyX3sPb1f5n95V0/TrTSrJLOxgWC3QkrGvQZOT+pq1RRXPKTk7yd2Zttu7P//Z", - "type": "image/jpeg", - "name": "test_image_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}.jpeg" - } - } - ] - } -} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products - POST - true - false - true - false - false - - tool/fragments/ce/api/create_product_with_extensible_data_objects.jmx - - - simple_product_id - $.id - - - BODY - - - - simple_product_sku - $.sku - - - BODY - - - - simple_stock_item_id - $.extension_attributes.stock_item.item_id - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - simple_product_id - - - - - ^[a-z0-9-]+$ - - Assertion.response_data - false - 1 - variable - simple_product_sku - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - simple_stock_item_id - - - - - - true - - - - true - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/${simple_product_sku} - GET - true - false - true - false - false - - tool/fragments/ce/api/check_product_with_extensible_data_objects.jmx - - - $.sku - ${simple_product_sku} - true - false - false - - - - $.id - ${simple_product_id} - true - false - false - - - - $.extension_attributes.stock_item.item_id - ${simple_stock_item_id} - true - false - false - - - - $.extension_attributes.stock_item.qty - 100 - true - false - false - - - - - - - - - - - - continue - - false - ${loops} - - ${graphQLPoolUsers} - ${ramp_period} - 1505803944000 - 1505803944000 - false - - - tool/fragments/_system/thread_group.jmx - - - 1 - false - 1 - ${graphqlGetListOfProductsByCategoryIdPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get List of Products by category_id"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - {"query":"query category($id: Int!, $currentPage: Int, $pageSize: Int) {\n category(id: $id) {\n product_count\n description\n url_key\n name\n id\n breadcrumbs {\n category_name\n category_url_key\n __typename\n }\n products(pageSize: $pageSize, currentPage: $currentPage, sort: {name: ASC}) {\n total_count\n items {\n id\n name\n # small_image\n # short_description\n url_key\n special_price\n special_from_date\n special_to_date\n price {\n regularPrice {\n amount {\n value\n currency\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n","variables":{"id":${category_id},"currentPage":1,"pageSize":12},"operationName":"category"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx - - - - - "name":"${category_name}","id":${category_id}, - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlGetSimpleProductDetailsByProductUrlKeyPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Simple Product Details by product_url_key"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlGetSimpleProductDetailsByNamePercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Simple Product Details by name"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($product_sku: String, $onServer: Boolean!) {\n productDetail: products(filter: { sku: { eq: $product_sku } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"product_sku":"${product_sku}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlGetConfigurableProductDetailsByProductUrlKeyPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Configurable Product Detail by product_url_key"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlGetConfigurableProductDetailsByNamePercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Configurable Product Detail by name"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetailByName($product_sku: String, $onServer: Boolean!) {\n products(filter: { sku: { eq: $product_sku } }, sort: {name: ASC}) {\n items {\n id\n sku\n name\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n #fashion_color\n #fashion_size\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"product_sku":"${product_sku}","onServer":false},"operationName":"productDetailByName"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlGetProductSearchByTextAndCategoryIdPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Product Search by text and category_id"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - {"query":"query productSearch($inputText: String!, $categoryId: String) {\n products(\n pageSize:12\n search: $inputText, filter: { category_id: { eq: $categoryId } }, sort: {name: ASC}) {\n items {\n id\n name\n small_image {\n label\n url\n }\n url_key\n price {\n regularPrice {\n amount {\n value\n currency\n }\n }\n }\n }\n total_count\n filters {\n name\n filter_items_count\n request_var\n filter_items {\n label\n value_string\n }\n }\n }\n}","variables":{"inputText":"Product","categoryId":"${category_id}"},"operationName":"productSearch"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx - - - - graphql_search_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - - - - - 1 - false - 1 - ${graphqlGetCategoryListByCategoryIdPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Category List by category_id"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - - {"query":"query categoryList($id: Int!) {\n category(id: $id) {\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}","variables":{"id":${category_id}},"operationName":"categoryList"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_category_list_by_category_id.jmx - - - javascript - - - - var category = vars.getObject("category"); -var response = JSON.parse(prev.getResponseDataAsString()); - -assertCategoryId(category, response); -assertCategoryChildren(category, response); - -function assertCategoryId(category, response) { - if (response.data == undefined || response.data.category == undefined || response.data.category.id != category.id) { - AssertionResult.setFailureMessage("Cannot find category with id \"" + category.id + "\""); - AssertionResult.setFailure(true); - } -} - -function assertCategoryChildren(category, response) { - foundCategory = response.data && response.data.category ? response.data.category : null; - if (foundCategory) { - var childrenFound = foundCategory.children.map(function (c) {return parseInt(c.id)}); - var children = category.children.map(function (c) {return parseInt(c)}); - if (JSON.stringify(children.sort()) != JSON.stringify(childrenFound.sort())) { - AssertionResult.setFailureMessage("Cannot math children categories \"" + JSON.stringify(children) + "\" for to found one: \"" + JSON.stringify(childrenFound) + "\""); - AssertionResult.setFailure(true); - } - } - -} - - - - - - - - - - 1 - false - 1 - ${graphqlGetCategoryListByCategoryIdPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Category List by category_url_key"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - {"query" : "{\n categoryList(filters:{url_key: {in: [\"${category_url_key}\"]}}) {\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_category_list_by_category_url_key.jmx - - - - javascript - - - - var category = vars.getObject("category"); -var response = JSON.parse(prev.getResponseDataAsString()); - -assertCategoryId(category, response); -assertCategoryChildren(category, response); - -function assertCategoryId(category, response) { - if (response.data == undefined || response.data.categoryList == undefined || response.data.categoryList[0].id != category.id) { - AssertionResult.setFailureMessage("Cannot find category with id \"" + category.id + "\""); - AssertionResult.setFailure(true); - } -} - -function assertCategoryChildren(category, response) { - foundCategory = response.data && response.data.categoryList ? response.data.categoryList[0] : null; - if (foundCategory) { - var childrenFound = foundCategory.children.map(function (c) {return parseInt(c.id)}); - var children = category.children.map(function (c) {return parseInt(c)}); - if (JSON.stringify(children.sort()) != JSON.stringify(childrenFound.sort())) { - AssertionResult.setFailureMessage("Cannot math children categories \"" + JSON.stringify(children) + "\" for to found one: \"" + JSON.stringify(childrenFound) + "\""); - AssertionResult.setFailure(true); - } - } - -} - - - - - - - - - - 1 - false - 1 - ${graphqlGetCategoryListByCategoryIdPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Multiple Categories"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); - -var numbers = []; - -var sanity = 0; -for(var i = 0; i < 4; i++){ - sanity++; - if(sanity > 100){ - break; - } - var number = random.nextInt(categories.length) - if(numbers.indexOf(number) >= 0){ - i--; - continue; - } - numbers.push(number); -} - -vars.put("category_id_1", categories[numbers[0]].id); -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); - - tool/fragments/ce/common/extract_multiple_categories_setup.jmx - - - - - true - - - - false - {"query" : "{\n categoryList(filters:{ids: {in: [\"${category_id_1}\", \"${category_id_2}\", \"${category_id_3}\", \"${category_id_4}\"]}}) {\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_multiple_categories_by_id.jmx - - - - javascript - - - - var response = JSON.parse(prev.getResponseDataAsString()); - -if(response.data == undefined || response.data.categoryList == undefined){ - AssertionResult.setFailureMessage("CategoryList results are empty."); - AssertionResult.setFailure(true); -} - -if(response.data.categoryList.length !== 4){ - AssertionResult.setFailureMessage("CategoryList query expected to find 4 categories. " + response.data.categoryList.length + " returned."); - AssertionResult.setFailure(true); -} - - - - - - - - - 1 - false - 1 - ${graphqlGetCategoryListByCategoryIdPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Categories Query: Get Multiple Categories By Id"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); - -var numbers = []; - -var sanity = 0; -for(var i = 0; i < 4; i++){ - sanity++; - if(sanity > 100){ - break; - } - var number = random.nextInt(categories.length) - if(numbers.indexOf(number) >= 0){ - i--; - continue; - } - numbers.push(number); -} - -vars.put("category_id_1", categories[numbers[0]].id); -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); - - tool/fragments/ce/common/extract_multiple_categories_setup.jmx - - - - - true - - - - false - {"query" : "{\n categories(filters:{ids: {in: [\"${category_id_1}\", \"${category_id_2}\", \"${category_id_3}\", \"${category_id_4}\"]}}) {\n total_count\n page_info {\n total_pages\n current_page\n page_size\n }\n items{\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n }\n}"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/categories_query_get_multiple_categories_by_id.jmx - - - - javascript - - - - var response = JSON.parse(prev.getResponseDataAsString()); - -if(response.data == undefined || response.data.categories == undefined){ - AssertionResult.setFailureMessage("Categories result is empty."); - AssertionResult.setFailure(true); -} - -if(response.data.categories.items.length !== 4){ - AssertionResult.setFailureMessage("Categories query expected to find 4 categories. " + response.data.categories.items.length + " returned."); - AssertionResult.setFailure(true); -} - - - - - - - - - 1 - false - 1 - ${graphqlGetCategoryListByCategoryIdPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Categories Query: Get Many Categories with Pagination"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"query" : "{\n categories(filters:{name: {match: \"Category\"}}) {\n total_count\n page_info {\n total_pages\n current_page\n page_size\n }\n items{\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n }\n}"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/categories_query_get_many_categories_by_name_match.jmx - - - - javascript - - - - var response = JSON.parse(prev.getResponseDataAsString()); - -if(response.data == undefined || response.data.categories == undefined){ - AssertionResult.setFailureMessage("Categories result is empty."); - AssertionResult.setFailure(true); -} - -if(response.data.categories.items.length != 20){ - AssertionResult.setFailureMessage("Categories query expected to find 20 categories. " + response.data.categories.items.length + " returned."); - AssertionResult.setFailure(true); -} - - - - - - - - - 1 - false - 1 - ${graphqlUrlInfoByUrlKeyPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Url Info by url_key"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - - {"query":"query resolveUrl($urlKey: String!) {\n urlResolver(url: $urlKey) {\n type\n id\n }\n}","variables":{"urlKey":"${category_url_key}${url_suffix}"},"operationName":"resolveUrl"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_url_info_by_url_key.jmx - - - - {"type":"CATEGORY","id":${category_id}} - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlGetCmsPageByIdPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Cms Page by id"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var cmsPages = props.get("cms_pages"); -var number = random.nextInt(cmsPages.length); - -vars.put("cms_page_id", cmsPages[number].id); - - tool/fragments/ce/setup/prepare_cms_page.jmx - - - - true - - - - false - - {"query":"query getCmsPage($id: Int!, $onServer: Boolean!) {\n cmsPage(id: $id) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"id":${cms_page_id},"onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx - - - $.data.cmsPage.url_key - ${cms_page_id} - false - false - false - false - - - - - - - - 1 - false - 1 - ${graphqlGetNavigationMenuByCategoryIdPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Navigation Menu by category_id"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - {"query":"query navigationMenu($id: Int!) {\n category(id: $id) {\n id\n name\n product_count\n path\n children {\n id\n name\n position\n level\n url_key\n url_path\n product_count\n children_count\n path\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}","variables":{"id":${category_id}},"operationName":"navigationMenu"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx - - - - - "id":${category_id},"name":"${category_name}","product_count" - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlCreateEmptyCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Create Empty Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlGetEmptyCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Get Empty Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_empty_cart.jmx - - - - - {"data":{"cart":{"items":[]}}} - - Assertion.response_data - false - 8 - - - - - - - - 1 - false - 1 - ${graphqlSetShippingAddressOnCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Set Shipping Address On Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_empty_cart.jmx - - - - - {"data":{"cart":{"items":[]}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"mutation {\n setShippingAddressesOnCart(\n input: {\n cart_id: \"${quote_id}\"\n shipping_addresses: [\n {\n address: {\n firstname: \"test firstname\"\n lastname: \"test lastname\"\n company: \"test company\"\n street: [\"test street 1\", \"test street 2\"]\n city: \"test city\"\n region: \"AZ\"\n postcode: \"887766\"\n country_code: \"US\"\n telephone: \"88776655\"\n save_in_address_book: false\n }\n }\n ]\n }\n ) {\n cart {\n shipping_addresses {\n firstname\n lastname\n company\n street\n city\n postcode\n telephone\n country {\n code\n label\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx - - - - - {"data":{"setShippingAddressesOnCart":{"cart":{"shipping_addresses":[{"firstname":"test firstname","lastname":"test lastname","company":"test company","street":["test street 1","test street 2"],"city":"test city","postcode":"887766","telephone":"88776655","country":{"code":"US","label":"US"}}]}}}} - - Assertion.response_data - false - 8 - - - - - - - - 1 - false - 1 - ${graphqlSetBillingAddressOnCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Set Billing Address On Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_empty_cart.jmx - - - - - {"data":{"cart":{"items":[]}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"mutation {\n setBillingAddressOnCart(\n input: {\n cart_id: \"${quote_id}\"\n billing_address: {\n address: {\n firstname: \"test firstname\"\n lastname: \"test lastname\"\n company: \"test company\"\n street: [\"test street 1\", \"test street 2\"]\n city: \"test city\"\n region: \"AZ\"\n postcode: \"887766\"\n country_code: \"US\"\n telephone: \"88776655\"\n save_in_address_book: false\n }\n }\n }\n ) {\n cart {\n billing_address {\n firstname\n lastname\n company\n street\n city\n postcode\n telephone\n country {\n code\n label\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_billing_address_on_cart.jmx - - - - - {"data":{"setBillingAddressOnCart":{"cart":{"billing_address":{"firstname":"test firstname","lastname":"test lastname","company":"test company","street":["test street 1","test street 2"],"city":"test city","postcode":"887766","telephone":"88776655","country":{"code":"US","label":"US"}}}}}} - - Assertion.response_data - false - 8 - - - - - - - - 1 - false - 1 - ${graphqlAddSimpleProductToCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Add Simple Product To Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"mutation { \n addSimpleProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n data: {\n quantity: 2\n sku: \"${product_sku}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n quantity\n product {\n sku\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_cart.jmx - - - - - addSimpleProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlAddConfigurableProductToCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Add Configurable Product To Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetailByName($product_sku: String, $onServer: Boolean!) {\n products(filter: { sku: { eq: $product_sku } }, sort: {name: ASC}) {\n items {\n id\n sku\n name\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n #fashion_color\n #fashion_size\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"product_sku":"${product_sku}","onServer":false},"operationName":"productDetailByName"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - product_option - $.data.products.items[0].variants[0].product.sku - - - BODY - tool/fragments/ce/graphql/extract_configurable_product_option.jmx - - - - - true - - - - false - {"query":"mutation {\n addConfigurableProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n variant_sku: \"${product_option}\"\n data: {\n quantity: 2\n sku: \"${product_option}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n id\n quantity\n product {\n name\n sku\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx - - - - - addConfigurableProductsToCart - "sku":"${product_option}" - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlUpdateSimpleProductQtyInCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Update Simple Product Qty In Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"mutation { \n addSimpleProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n data: {\n quantity: 2\n sku: \"${product_sku}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n quantity\n product {\n sku\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_cart.jmx - - - - - addSimpleProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_cart.jmx - - - - item_id - $.data.cart.items[0].id - - - BODY - - - - - {"data":{"cart":{"items": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation {\n updateCartItems(input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n cart_item_id: ${item_id}\n quantity: 5\n }\n ]\n }) {\n cart {\n items {\n id\n quantity\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/update_simple_product_qty_in_cart.jmx - - - - - {"data":{"updateCartItems":{"cart":{"items":[{"id":"${item_id}","quantity":5}]}}}} - - Assertion.response_data - false - 8 - - - - - - - - 1 - false - 1 - ${graphqlUpdateConfigurableProductQtyInCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Update Configurable Product Qty In Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetailByName($product_sku: String, $onServer: Boolean!) {\n products(filter: { sku: { eq: $product_sku } }, sort: {name: ASC}) {\n items {\n id\n sku\n name\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n #fashion_color\n #fashion_size\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"product_sku":"${product_sku}","onServer":false},"operationName":"productDetailByName"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - product_option - $.data.products.items[0].variants[0].product.sku - - - BODY - tool/fragments/ce/graphql/extract_configurable_product_option.jmx - - - - - true - - - - false - {"query":"mutation {\n addConfigurableProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n variant_sku: \"${product_option}\"\n data: {\n quantity: 2\n sku: \"${product_option}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n id\n quantity\n product {\n name\n sku\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx - - - - - addConfigurableProductsToCart - "sku":"${product_option}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_cart.jmx - - - - item_id - $.data.cart.items[0].id - - - BODY - - - - - {"data":{"cart":{"items": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation {\n updateCartItems(input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n cart_item_id: ${item_id}\n quantity: 5\n }\n ]\n }) {\n cart {\n items {\n id\n quantity\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/update_configurable_product_qty_in_cart.jmx - - - - - {"data":{"updateCartItems":{"cart":{"items":[{"id":"${item_id}","quantity":5}]}}}} - - Assertion.response_data - false - 8 - - - - - - - - 1 - false - 1 - ${graphqlUpdateSimpleProductQtyInCartWithPricesPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Update Simple Product Qty In Cart with Prices"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"mutation { \n addSimpleProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n data: {\n quantity: 2\n sku: \"${product_sku}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n quantity\n prices {\n row_total{\n value\n }\n total_item_discount {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n row_total_including_tax{\n value\n }\n }\n product {\n sku\n }\n }\n prices {\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n subtotal_excluding_tax {\n value\n currency\n }\n subtotal_including_tax {\n value\n currency\n }\n subtotal_with_discount_excluding_tax {\n value\n currency\n }\n }\n }\n }\n}\n","variables":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_cart_with_prices.jmx - - - - - addSimpleProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n prices {\n row_total{\n value\n }\n row_total_including_tax{\n value\n }\n total_item_discount{value}\n discounts{\n amount{value}\n label\n }\n }\n product {\n sku\n }\n }\n prices {\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n subtotal_excluding_tax {\n value\n currency\n }\n subtotal_including_tax {\n value\n currency\n }\n subtotal_with_discount_excluding_tax {\n value\n currency\n }\n }\n }\n}\n","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_cart_with_prices.jmx - - - - item_id - $.data.cart.items[0].id - - - BODY - - - - - {"data":{"cart":{"items": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation {\n updateCartItems(input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n cart_item_id: ${item_id}\n quantity: 5\n }\n ]\n }) {\n cart {\n items {\n id\n quantity\n prices {\n row_total{\n value\n }\n total_item_discount {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n row_total_including_tax{\n value\n }\n }\n product {\n sku\n }\n }\n prices {\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n subtotal_excluding_tax {\n value\n currency\n }\n subtotal_including_tax {\n value\n currency\n }\n subtotal_with_discount_excluding_tax {\n value\n currency\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/update_simple_product_qty_in_cart_with_prices.jmx - - - - - "quantity":5 - "id":"${item_id}" - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlUpdateConfigurableProductQtyInCartWithPricesPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Update Configurable Product Qty In Cart with Prices"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetailByName($product_sku: String, $onServer: Boolean!) {\n products(filter: { sku: { eq: $product_sku } }, sort: {name: ASC}) {\n items {\n id\n sku\n name\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n #fashion_color\n #fashion_size\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"product_sku":"${product_sku}","onServer":false},"operationName":"productDetailByName"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - product_option - $.data.products.items[0].variants[0].product.sku - - - BODY - tool/fragments/ce/graphql/extract_configurable_product_option.jmx - - - - - true - - - - false - {"query":"mutation {\n addConfigurableProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n variant_sku: \"${product_option}\"\n data: {\n quantity: 2\n sku: \"${product_option}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n id\n quantity\n prices {\n row_total{\n value\n }\n total_item_discount {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n row_total_including_tax{\n value\n }\n }\n product {\n name\n sku\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n }\n }\n }\n prices {\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n subtotal_excluding_tax {\n value\n currency\n }\n subtotal_including_tax {\n value\n currency\n }\n subtotal_with_discount_excluding_tax {\n value\n currency\n }\n }\n }\n }\n}\n","variables":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_configurable_product_to_cart_with_prices.jmx - - - - - addConfigurableProductsToCart - "sku":"${product_option}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n prices {\n row_total{\n value\n }\n row_total_including_tax{\n value\n }\n total_item_discount{value}\n discounts{\n amount{value}\n label\n }\n }\n product {\n sku\n }\n }\n prices {\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n subtotal_excluding_tax {\n value\n currency\n }\n subtotal_including_tax {\n value\n currency\n }\n subtotal_with_discount_excluding_tax {\n value\n currency\n }\n }\n }\n}\n","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_cart_with_prices.jmx - - - - item_id - $.data.cart.items[0].id - - - BODY - - - - - {"data":{"cart":{"items": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation {\n updateCartItems(input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n cart_item_id: ${item_id}\n quantity: 5\n }\n ]\n }) {\n cart {\n items {\n id\n quantity\n prices {\n row_total{\n value\n }\n total_item_discount {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n row_total_including_tax{\n value\n }\n }\n product {\n name\n sku\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n }\n }\n }\n prices {\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n subtotal_excluding_tax {\n value\n currency\n }\n subtotal_including_tax {\n value\n currency\n }\n subtotal_with_discount_excluding_tax {\n value\n currency\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/update_configurable_product_qty_in_cart_with_prices.jmx - - - - - "quantity":5 - "id":"${item_id}" - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${graphqlRemoveSimpleProductFromCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Remove Simple Product From Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"mutation { \n addSimpleProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n data: {\n quantity: 2\n sku: \"${product_sku}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n quantity\n product {\n sku\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_cart.jmx - - - - - addSimpleProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_cart.jmx - - - - item_id - $.data.cart.items[0].id - - - BODY - - - - - {"data":{"cart":{"items": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation {\n removeItemFromCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_item_id: ${item_id}\n }\n ) {\n cart {\n items {\n quantity\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/remove_simple_product_from_cart.jmx - - - - - {"data":{"removeItemFromCart":{"cart":{"items":[]}}}} - - Assertion.response_data - false - 8 - - - - - - - - 1 - false - 1 - ${graphqlRemoveConfigurableProductFromCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Remove Configurable Product From Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetailByName($product_sku: String, $onServer: Boolean!) {\n products(filter: { sku: { eq: $product_sku } }, sort: {name: ASC}) {\n items {\n id\n sku\n name\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n #fashion_color\n #fashion_size\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"product_sku":"${product_sku}","onServer":false},"operationName":"productDetailByName"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - product_option - $.data.products.items[0].variants[0].product.sku - - - BODY - tool/fragments/ce/graphql/extract_configurable_product_option.jmx - - - - - true - - - - false - {"query":"mutation {\n addConfigurableProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n variant_sku: \"${product_option}\"\n data: {\n quantity: 2\n sku: \"${product_option}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n id\n quantity\n product {\n name\n sku\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx - - - - - addConfigurableProductsToCart - "sku":"${product_option}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_cart.jmx - - - - item_id - $.data.cart.items[0].id - - - BODY - - - - - {"data":{"cart":{"items": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation {\n removeItemFromCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_item_id: ${item_id}\n }\n ) {\n cart {\n items {\n quantity\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/remove_configurable_product_from_cart.jmx - - - - - {"data":{"removeItemFromCart":{"cart":{"items":[]}}}} - - Assertion.response_data - false - 8 - - - - - - - - 1 - false - 1 - ${graphqlApplyCouponToCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Apply Coupon To Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"mutation { \n addSimpleProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n data: {\n quantity: 2\n sku: \"${product_sku}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n quantity\n product {\n sku\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_cart.jmx - - - - - addSimpleProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var coupons = props.get("coupon_codes"); -number = random.nextInt(coupons.length); - -vars.put("coupon_code", coupons[number].code); - - tool/fragments/ce/common/extract_coupon_code_setup.jmx - - - - - true - - - - false - {"query":"mutation {\n applyCouponToCart(input: {cart_id: \"${quote_id}\", coupon_code: \"${coupon_code}\"}) {\n cart {\n applied_coupon {\n code\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/apply_coupon_to_cart.jmx - - - - - {"data":{"applyCouponToCart":{"cart":{"applied_coupon":{"code":"${coupon_code}"}}}}} - - Assertion.response_data - false - 8 - - - - - - - - 1 - false - 1 - ${graphqlRemoveCouponFromCartPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Remove Coupon From Cart"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"mutation { \n addSimpleProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n data: {\n quantity: 2\n sku: \"${product_sku}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n quantity\n product {\n sku\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_cart.jmx - - - - - addSimpleProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var coupons = props.get("coupon_codes"); -number = random.nextInt(coupons.length); - -vars.put("coupon_code", coupons[number].code); - - tool/fragments/ce/common/extract_coupon_code_setup.jmx - - - - - true - - - - false - {"query":"mutation {\n applyCouponToCart(input: {cart_id: \"${quote_id}\", coupon_code: \"${coupon_code}\"}) {\n cart {\n applied_coupon {\n code\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/apply_coupon_to_cart.jmx - - - - - {"data":{"applyCouponToCart":{"cart":{"applied_coupon":{"code":"${coupon_code}"}}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"mutation {\n removeCouponFromCart(input: {cart_id: \"${quote_id}\"}) {\n cart {\n applied_coupon {\n code\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/remove_coupon_from_cart.jmx - - - - - {"data":{"removeCouponFromCart":{"cart":{"applied_coupon":null}}}} - - Assertion.response_data - false - 8 - - - - - - - - 1 - false - 1 - ${graphqlCatalogBrowsingByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Catalog Browsing By Guest"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - {"query":"query navigationMenu($id: Int!) {\n category(id: $id) {\n id\n name\n product_count\n path\n children {\n id\n name\n position\n level\n url_key\n url_path\n product_count\n children_count\n path\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}","variables":{"id":${category_id}},"operationName":"navigationMenu"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_navigation_menu_by_category_id.jmx - - - - - "id":${category_id},"name":"${category_name}","product_count" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"query productSearch($inputText: String!, $categoryId: String) {\n products(\n pageSize:12\n search: $inputText, filter: { category_id: { eq: $categoryId } }, sort: {name: ASC}) {\n items {\n id\n name\n small_image {\n label\n url\n }\n url_key\n price {\n regularPrice {\n amount {\n value\n currency\n }\n }\n }\n }\n total_count\n filters {\n name\n filter_items_count\n request_var\n filter_items {\n label\n value_string\n }\n }\n }\n}","variables":{"inputText":"Product","categoryId":"${category_id}"},"operationName":"productSearch"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_product_search_by_text_and_category_id.jmx - - - - graphql_search_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - - - true - - - - false - - {"query":"query resolveUrl($urlKey: String!) {\n urlResolver(url: $urlKey) {\n type\n id\n }\n}","variables":{"urlKey":"${category_url_key}${url_suffix}"},"operationName":"resolveUrl"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_url_info_by_url_key.jmx - - - - {"type":"CATEGORY","id":${category_id}} - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"query category($id: Int!, $currentPage: Int, $pageSize: Int) {\n category(id: $id) {\n product_count\n description\n url_key\n name\n id\n breadcrumbs {\n category_name\n category_url_key\n __typename\n }\n products(pageSize: $pageSize, currentPage: $currentPage, sort: {name: ASC}) {\n total_count\n items {\n id\n name\n # small_image\n # short_description\n url_key\n special_price\n special_from_date\n special_to_date\n price {\n regularPrice {\n amount {\n value\n currency\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n","variables":{"id":${category_id},"currentPage":1,"pageSize":12},"operationName":"category"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx - - - - - "name":"${category_name}","id":${category_id}, - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetailByName($product_sku: String, $onServer: Boolean!) {\n products(filter: { sku: { eq: $product_sku } }, sort: {name: ASC}) {\n items {\n id\n sku\n name\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n #fashion_color\n #fashion_size\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"product_sku":"${product_sku}","onServer":false},"operationName":"productDetailByName"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($product_sku: String, $onServer: Boolean!) {\n productDetail: products(filter: { sku: { eq: $product_sku } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"product_sku":"${product_sku}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_simple_product_details_by_name.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var cmsPages = props.get("cms_pages"); -var number = random.nextInt(cmsPages.length); - -vars.put("cms_page_id", cmsPages[number].id); - - tool/fragments/ce/setup/prepare_cms_page.jmx - - - - true - - - - false - - {"query":"query getCmsPage($id: Int!, $onServer: Boolean!) {\n cmsPage(id: $id) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"id":${cms_page_id},"onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx - - - $.data.cmsPage.url_key - ${cms_page_id} - false - false - false - false - - - - - - - - 1 - false - 1 - ${graphqlCheckoutByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Checkout By Guest"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_empty_cart.jmx - - - - - {"data":{"cart":{"items":[]}}} - - Assertion.response_data - false - 8 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetailByName($product_sku: String, $onServer: Boolean!) {\n products(filter: { sku: { eq: $product_sku } }, sort: {name: ASC}) {\n items {\n id\n sku\n name\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n #fashion_color\n #fashion_size\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"product_sku":"${product_sku}","onServer":false},"operationName":"productDetailByName"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - product_option - $.data.products.items[0].variants[0].product.sku - - - BODY - tool/fragments/ce/graphql/extract_configurable_product_option.jmx - - - - - true - - - - false - {"query":"mutation {\n addConfigurableProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n variant_sku: \"${product_option}\"\n data: {\n quantity: 2\n sku: \"${product_option}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n id\n quantity\n product {\n name\n sku\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx - - - - - addConfigurableProductsToCart - "sku":"${product_option}" - - Assertion.response_data - false - 2 - - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"mutation { \n addSimpleProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n data: {\n quantity: 2\n sku: \"${product_sku}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n quantity\n product {\n sku\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_cart.jmx - - - - - addSimpleProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation {\n setBillingAddressOnCart(\n input: {\n cart_id: \"${quote_id}\"\n billing_address: {\n address: {\n firstname: \"test firstname\"\n lastname: \"test lastname\"\n company: \"test company\"\n street: [\"test street 1\", \"test street 2\"]\n city: \"test city\"\n region: \"AZ\"\n postcode: \"887766\"\n country_code: \"US\"\n telephone: \"88776655\"\n save_in_address_book: false\n }\n }\n }\n ) {\n cart {\n billing_address {\n firstname\n lastname\n company\n street\n city\n postcode\n telephone\n country {\n code\n label\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_billing_address_on_cart.jmx - - - - - {"data":{"setBillingAddressOnCart":{"cart":{"billing_address":{"firstname":"test firstname","lastname":"test lastname","company":"test company","street":["test street 1","test street 2"],"city":"test city","postcode":"887766","telephone":"88776655","country":{"code":"US","label":"US"}}}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"mutation {\n setShippingAddressesOnCart(\n input: {\n cart_id: \"${quote_id}\"\n shipping_addresses: [\n {\n address: {\n firstname: \"test firstname\"\n lastname: \"test lastname\"\n company: \"test company\"\n street: [\"test street 1\", \"test street 2\"]\n city: \"test city\"\n region: \"AZ\"\n postcode: \"887766\"\n country_code: \"US\"\n telephone: \"88776655\"\n save_in_address_book: false\n }\n }\n ]\n }\n ) {\n cart {\n shipping_addresses {\n firstname\n lastname\n company\n street\n city\n postcode\n telephone\n country {\n code\n label\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx - - - - - {"data":{"setShippingAddressesOnCart":{"cart":{"shipping_addresses":[{"firstname":"test firstname","lastname":"test lastname","company":"test company","street":["test street 1","test street 2"],"city":"test city","postcode":"887766","telephone":"88776655","country":{"code":"US","label":"US"}}]}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"mutation {\n setPaymentMethodOnCart(input: {\n cart_id: \"${quote_id}\", \n payment_method: {\n code: \"checkmo\"\n }\n }) {\n cart {\n selected_payment_method {\n code\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_payment_method_on_cart.jmx - - - - - {"data":{"setPaymentMethodOnCart":{"cart":{"selected_payment_method":{"code":"checkmo"}}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n shipping_addresses {\n postcode\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_current_shipping_address.jmx - - - - - true - - - - false - {"query":"mutation {\n setShippingMethodsOnCart(input: \n {\n cart_id: \"${quote_id}\", \n shipping_methods: [{\n carrier_code: \"flatrate\"\n method_code: \"flatrate\"\n }]\n }) {\n cart {\n shipping_addresses {\n selected_shipping_method {\n carrier_code\n method_code\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx - - - - - {"data":{"setShippingMethodsOnCart":{"cart":{"shipping_addresses":[{"selected_shipping_method":{"carrier_code":"flatrate","method_code":"flatrate"}}]}}}} - - Assertion.response_data - false - 8 - - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var coupons = props.get("coupon_codes"); -number = random.nextInt(coupons.length); - -vars.put("coupon_code", coupons[number].code); - - tool/fragments/ce/common/extract_coupon_code_setup.jmx - - - - - true - - - - false - {"query":"mutation {\n applyCouponToCart(input: {cart_id: \"${quote_id}\", coupon_code: \"${coupon_code}\"}) {\n cart {\n applied_coupon {\n code\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/apply_coupon_to_cart.jmx - - - - - {"data":{"applyCouponToCart":{"cart":{"applied_coupon":{"code":"${coupon_code}"}}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"mutation {\n removeCouponFromCart(input: {cart_id: \"${quote_id}\"}) {\n cart {\n applied_coupon {\n code\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/remove_coupon_from_cart.jmx - - - - - {"data":{"removeCouponFromCart":{"cart":{"applied_coupon":null}}}} - - Assertion.response_data - false - 8 - - - - - - - - 1 - false - 1 - ${graphqlCheckoutALargeBulkOfProductsByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "GraphQL Checkout A Large Bulk Of Products By Guest"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - tool/fragments/ce/common/init_total_simple_and_configurable_products_in_cart_setup.jmx - -vars.put("totalSimpleProductsAdded", "0"); -vars.put("totalConfigurableProductsAdded", "0"); - - - - true - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_empty_cart.jmx - - - - - {"data":{"cart":{"items":[]}}} - - Assertion.response_data - false - 8 - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -simpleProductsAdded = Integer.parseInt(vars.get("totalSimpleProductsAdded")); -lastSimpleProduct = Integer.parseInt(vars.get("numberOfRelatedSimpleProductsInTheCart")) - 1; - -product = props.get("simple_products_list").get(lastSimpleProduct); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - -simpleProductsAdded = simpleProductsAdded + 1; -vars.put("totalSimpleProductsAdded", String.valueOf(simpleProductsAdded)); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup_large_bulk_of_products.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - true - - - - false - {"query":"mutation{ addProductsToCart( cartId: \"${quote_id}\" cartItems: [{ sku: \"${product_sku}\" quantity: 1 }, ${related_product}] ){ cart{ id items{ product{ sku } quantity } } } }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 8000000 - 8000000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/large_number_of_products_in_the_card/add_simple_products_to_cart.jmx - - - - - addProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - groovy - - - true - - numberOfSimpleProducts = Integer.parseInt(vars.get("numberOfRelatedSimpleProductsInTheCart")) - 1; - def relatedProductSKUs = props.get('simple_products_list').take(numberOfSimpleProducts).inject('') {acc, prod -> acc + '{ sku: \\"' + prod.get("sku") + '\\" quantity: 1 },' }; - vars.put('related_product', relatedProductSKUs); - - simpleProductsAdded = Integer.parseInt(vars.get("totalSimpleProductsAdded")); - simpleProductsAdded = simpleProductsAdded + numberOfSimpleProducts; - vars.put("totalSimpleProductsAdded", String.valueOf(simpleProductsAdded)); - - productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); - productsAdded = productsAdded + numberOfSimpleProducts; - vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - tool/fragments/ce/graphql/large_number_of_products_in_the_card/related_products_add_to_cart_preprocessor.jmx - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -configurableProductsAdded = Integer.parseInt(vars.get("totalConfigurableProductsAdded")); - -product = props.get("configurable_products_list").get(configurableProductsAdded); - -vars.put("product_number", configurableProductsAdded.toString()); -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - -configurableProductsAdded = configurableProductsAdded + 1; -vars.put("totalConfigurableProductsAdded", String.valueOf(configurableProductsAdded)); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup_large_number_of_products.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - true - - - - false - {"query":"query productDetailByName($product_sku: String, $onServer: Boolean!) {\n products(filter: { sku: { eq: $product_sku } }, sort: {name: ASC}) {\n items {\n id\n sku\n name\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n #fashion_color\n #fashion_size\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"product_sku":"${product_sku}","onServer":false},"operationName":"productDetailByName"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_name.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - product_option - $.data.products.items[0].variants[0].product.sku - - - BODY - tool/fragments/ce/graphql/extract_configurable_product_option.jmx - - - - - true - - - - false - {"query":"mutation { addProductsToCart( cartId: \"${quote_id}\" cartItems: [ { quantity: 1 parent_sku: \"${product_sku}\" sku: \"${product_option}\" } ] ) { cart { items { id product { name sku } quantity } } } }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/large_number_of_products_in_the_card/add_configurable_product_to_cart.jmx - - - - - addProductsToCart - "sku":"${product_option}" - - Assertion.response_data - false - 2 - - - - - - - true - - - - false - {"query":"mutation{ setBillingAddressOnCart(input: { cart_id: \"${quote_id}\" billing_address: { address: { city: \"Los Angeles\" country_code: \"US\" firstname: \"Async\" lastname: \"Test\" region_id: 12 postcode: \"90004\" street: [ \"123 Homey Lane\" ] telephone: \"6666666666\" } use_for_shipping: true } }){ cart{ id billing_address{ firstname lastname telephone country{ code } region { label region_id } city postcode street } shipping_addresses{ firstname lastname telephone country{ code } region { label region_id } city postcode street } } } }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/large_number_of_products_in_the_card/set_billing_and_shipping_address_on_cart.jmx - - - - - "firstname":"Async","lastname":"Test","telephone":"6666666666" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation{ setPaymentMethodOnCart(input: { cart_id: \"${quote_id}\" payment_method: { code: \"checkmo\" } }){ cart{ id selected_payment_method{ code title } } } }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/large_number_of_products_in_the_card/set_payment_method_on_cart.jmx - - - - - Money order - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation { setGuestEmailOnCart( input: { cart_id: \"${quote_id}\" email: \"customer@example.com\" } ) { cart { email } } }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/large_number_of_products_in_the_card/set_guest_email_on_cart.jmx - - - - - {"data":{"setGuestEmailOnCart":{"cart":{"email":"customer@example.com"}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"mutation {\n setShippingMethodsOnCart(input: \n {\n cart_id: \"${quote_id}\", \n shipping_methods: [{\n carrier_code: \"flatrate\"\n method_code: \"flatrate\"\n }]\n }) {\n cart {\n shipping_addresses {\n selected_shipping_method {\n carrier_code\n method_code\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/large_number_of_products_in_the_card/set_shipping_method_on_cart.jmx - - - - - {"data":{"setShippingMethodsOnCart":{"cart":{"shipping_addresses":[{"selected_shipping_method":{"carrier_code":"flatrate","method_code":"flatrate"}}]}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"{ cart(cart_id: \"${quote_id}\") { total_quantity email billing_address { city country { code label } firstname lastname postcode region { code label } street telephone } shipping_addresses { firstname lastname street city region { code label } country { code label } telephone available_shipping_methods { amount { currency value } available carrier_code carrier_title error_message method_code method_title price_excl_tax { value currency } price_incl_tax { value currency } } selected_shipping_method { amount { value currency } carrier_code carrier_title method_code method_title } } items { id product { name sku } quantity } available_payment_methods { code title } selected_payment_method { code title } applied_coupons { code } prices { grand_total { value currency } } } }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/large_number_of_products_in_the_card/get_cart.jmx - - - - $.data.cart.total_quantity - ${totalProductsAdded} - true - false - false - false - - - - - - true - - - - false - {"query":"{ cart(cart_id: \"${quote_id}\") { total_quantity email billing_address { city country { code label } firstname lastname postcode region { code label } street telephone } shipping_addresses { firstname lastname street city region { code label } country { code label } telephone available_shipping_methods { amount { currency value } available carrier_code carrier_title error_message method_code method_title price_excl_tax { value currency } price_incl_tax { value currency } } selected_shipping_method { amount { value currency } carrier_code carrier_title method_code method_title } } items { id product { name sku } quantity } available_payment_methods { code title } selected_payment_method { code title } applied_coupons { code } prices { grand_total { value currency } } } }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/large_number_of_products_in_the_card/get_cart.jmx - - - - $.data.cart.total_quantity - ${totalProductsAdded} - true - false - false - false - - - - - - true - - - - false - {"query":"mutation{ placeOrder(input: { cart_id: \"${quote_id}\" }) { order{ order_number } } }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/large_number_of_products_in_the_card/place_the_order.jmx - - - - - {"data":{"placeOrder":{"order":{"order_number":" - - Assertion.response_data - false - 2 - - - - - - - - - - continue - - false - ${loops} - - ${combinedBenchmarkPoolUsers} - ${ramp_period} - 1505803944000 - 1505803944000 - false - - - tool/fragments/_system/thread_group.jmx - - - javascript - - - - var cacheHitPercent = vars.get("cache_hits_percentage"); - -if ( - cacheHitPercent < 100 && - sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - doCache(); -} - -function doCache(){ - var random = Math.random() * 100; - if (cacheHitPercent < random) { - sampler.setPath(sampler.getPath() + "?cacheModifier=" + Math.random().toString(36).substring(2, 13)); - } -} - - tool/fragments/ce/common/cache_hit_miss.jmx - - - - 1 - false - 1 - ${cBrowseCatalogByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Catalog Browsing By Guest"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${cSiteSearchPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Site Search"); - - true - - - - - ${files_folder}search_terms.csv - UTF-8 - - , - false - true - false - shareMode.thread - tool/fragments/ce/search/search_terms.jmx - - - - javascript - - - - var cacheHitPercent = vars.get("cache_hits_percentage"); - -if ( - cacheHitPercent < 100 && - sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - doCache(); -} - -function doCache(){ - var random = Math.random() * 100; - if (cacheHitPercent < random) { - sampler.setPath(sampler.getPath() + "?cacheModifier=" + Math.random().toString(36).substring(2, 13)); - } -} - - tool/fragments/ce/common/cache_hit_miss.jmx - - - - 1 - false - 1 - ${searchQuickPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Quick Search"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - q - ${searchTerm} - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalogsearch/result/ - GET - true - false - true - false - false - - tool/fragments/ce/search/search_quick.jmx - - - - Search results for: - <span class="toolbar-number">\d<\/span> Items|Items <span class="toolbar-number">1 - - Assertion.response_data - false - 2 - - - - false - product_url_keys - <a class="product-item-link"(?s).+?href="(?:http|https)://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s). - $2$ - - -1 - - - - false - isPageCacheable - catalogsearch/searchTermsLog/save - $0$ - 0 - 1 - - - - - - "${isPageCacheable}" != "0" - false - tool/fragments/ce/search/if_page_cacheable_controller.jmx - - - - - - true - q - ${searchTerm} - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalogsearch/searchTermsLog/save/ - GET - true - false - true - false - false - - tool/fragments/ce/search/search_terms_log_save.jmx - - - - - "success":true - - Assertion.response_data - false - 2 - - - - - - - -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup.jmx - -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${searchQuickFilterPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Quick Search With Filtration"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - q - ${searchTerm} - = - true - - - - - - 60000 - 200000 - - - ${base_path}catalogsearch/result/ - GET - true - false - true - false - false - - tool/fragments/ce/search/search_quick_filter.jmx - - - - Search results for: - Items <span class="toolbar-number">1 - - Assertion.response_data - false - 2 - - - - 0 - attribute_1_options_count - count((//div[@class="filter-options-content"])[1]//li[@class="item"]) - false - true - false - - - - 0 - attribute_2_options_count - count((//div[@class="filter-options-content"])[2]//li[@class="item"]) - false - true - false - - - - - attribute_1_filter_url - ((//div[@class="filter-options-content"])[1]//li[@class="item"]//a)[1]/@href - false - true - false - - - - false - product_url_keys - <a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s). - $2$ - - -1 - - - - false - isPageCacheable - catalogsearch/searchTermsLog/save - $0$ - 0 - 1 - - - - - - "${isPageCacheable}" != "0" - false - tool/fragments/ce/search/if_page_cacheable_controller.jmx - - - - - - true - q - ${searchTerm} - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalogsearch/searchTermsLog/save/ - GET - true - false - true - false - false - - tool/fragments/ce/search/search_terms_log_save.jmx - - - - - "success":true - - Assertion.response_data - false - 2 - - - - - - - ${attribute_1_options_count} > 0 - false - tool/fragments/ce/search/search_quick_filter-first-attribute.jmx - - - vars.put("search_url", vars.get("attribute_1_filter_url")); - - - false - - - - - - - - - 60000 - 200000 - - - ${attribute_1_filter_url} - GET - true - false - true - false - false - - - - - - Search results for: - <span class="toolbar-number">[1-9]+ - - Assertion.response_data - false - 2 - - - - 0 - attribute_2_options_count - count((//div[@class="filter-options-content"])[2]//li[@class="item"]) - false - true - false - - - - - attribute_2_filter_url - ((//div[@class="filter-options-content"])[2]//li[@class="item"]//a)[1]/@href - false - true - false - - - - false - product_url_keys - <a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s). - $2$ - - -1 - - - - - - - ${attribute_2_options_count} > 0 - false - tool/fragments/ce/search/search_quick_filter-second-attribute.jmx - - - vars.put("search_url", vars.get("attribute_2_filter_url")); - - - false - - - - - - - - - 60000 - 200000 - - - ${attribute_2_filter_url} - GET - true - false - true - false - false - - - - - - Search results for: - <span class="toolbar-number">[1-9]+ - - Assertion.response_data - false - 2 - - - - false - product_url_keys - <a class="product-item-link"(?s).+?href="http://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s). - $2$ - - -1 - - - - - - - -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup.jmx - -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${searchAdvancedPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Advanced Search"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - - 60000 - 200000 - - - ${base_path}catalogsearch/advanced/ - GET - true - false - true - false - false - - tool/fragments/ce/search/open_advanced_search_page.jmx - - - - <title>Advanced Search</title> - - Assertion.response_data - false - 2 - - - - - attribute_name - (//select[@class="multiselect"])[last()]/@name - false - true - false - - - - 0 - attribute_options_count - count((//select[@class="multiselect"])[last()]/option) - false - true - false - - - - - attribute_value - ((//select[@class="multiselect"])[last()]/option)[1]/@value - false - true - false - - - - - - - - - - - true - name - - = - true - - - true - sku - - = - true - - - true - description - ${searchTerm} - = - true - - - true - short_description - - = - true - - - true - price%5Bfrom%5D - - = - true - - - true - price%5Bto%5D - ${priceTo} - = - true - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalogsearch/advanced/result/ - GET - true - false - true - false - false - - tool/fragments/ce/search/search_advanced.jmx - - - - items</strong> were found using the following search criteria - - Assertion.response_data - false - 2 - - - - false - product_url_keys - <a class="product-item-link"(?s).+?href="(?:http|https)://${host}${base_path}(index.php/)?([^'"]+)${url_suffix}">(?s). - $2$ - - -1 - - - - - - -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup.jmx - -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - - - 1 - false - 1 - ${cAddToCartByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Add To Cart By Guest"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - true - 1 - tool/fragments/ce/common/get_configurable_product_options.jmx - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - 1 - false - 1 - ${cAddToWishlistPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Add to Wishlist"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/login/ - GET - true - false - true - false - false - - tool/fragments/ce/common/open_login_page.jmx - - - - <title>Customer Login</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${customer_email} - = - true - login[username] - - - true - ${customer_password} - = - true - login[password] - - - true - - = - true - send - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/loginPost/ - POST - true - false - true - false - false - - tool/fragments/ce/common/login.jmx - - - - <title>My Account</title> - - Assertion.response_data - false - 2 - - - - false - addressId - customer/address/edit/id/([^'"]+)/ - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - addressId - - - - - - - - true - - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - true - 5 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - false - - - true - ${product_uenc} - = - true - uenc - - - true - ${product_id} - = - true - product - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}wishlist/index/add/ - POST - true - false - true - false - false - - tool/fragments/ce/wishlist/add_to_wishlist.jmx - - - - <title>My Wish List</title> - - Assertion.response_data - false - 16 - - - - false - wishListItems - data-post-remove='\{"action":"(.+)\/wishlist\\/index\\/remove\\/","data":\{"item":"([^"]+)" - $2$ - - -1 - - - - - - - - - true - wishlist,messages - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/wishlist/load_wishlist_section.jmx - - - - {"wishlist":{"counter":" - - Assertion.response_data - false - 16 - - - - ${wishlistDelay}*1000 - - - - - - - wishListItems - wishListItem - true - tool/fragments/ce/wishlist/clear_wishlist.jmx - - - 1 - 5 - 1 - counter - - true - true - - - - - - - true - ${form_key} - = - true - form_key - true - - - true - ${wishListItem} - = - true - item - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}wishlist/index/remove/ - POST - true - false - true - false - false - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/common/logout.jmx - - - - You are signed out. - - Assertion.response_data - false - 2 - - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cCompareProductsPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Compare Products"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_compare/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - random_product_compare_id - catalog\\/product_compare\\/add\\/\",\"data\":\{\"product\":\"([0-9]+)\" - $1$ - - 1 - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - random_product_compare_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - ${form_key} - = - true - form_key - - - true - ${product_uenc} - = - true - uenc - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalog/product_compare/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_compare/product_compare_add.jmx - - - - - - - true - compare-products,messages - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx - - - - \"compare-products\":{\"count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - ${form_key} - = - true - form_key - - - true - ${product_uenc} - = - true - uenc - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalog/product_compare/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_compare/product_compare_add.jmx - - - - - - - true - compare-products,messages - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/product_compare/customer_section_load_product_compare_add.jmx - - - - \"compare-products\":{\"count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalog/product_compare/index/ - GET - true - false - true - false - false - - tool/fragments/ce/product_compare/compare_products.jmx - - - - 1 - 0 - ${__javaScript(Math.round(${productCompareDelay}*1000))} - tool/fragments/ce/product_compare/compare_products_pause.jmx - - - - - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}catalog/product_compare/clear - POST - true - false - true - false - false - - tool/fragments/ce/product_compare/compare_products_clear.jmx - - - - - - 1 - false - 1 - ${cCheckoutByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Checkout By Guest"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - true - 1 - tool/fragments/ce/common/get_configurable_product_options.jmx - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/ - GET - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_start.jmx - - - - <title>Checkout</title> - - Assertion.response_data - false - 2 - - - - - <title>Shopping Cart</title> - - Assertion.response_data - false - 6 - - - - false - cart_id - "quoteData":{"entity_id":"([^'"]+)", - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - - - true - - - - false - {"customerEmail":"test@example.com"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/customers/isEmailAvailable - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_email_available.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - true - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"address":{"country_id":"US","postcode":"95630"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/estimate-shipping-methods - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "available":true - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"addressInformation":{"shipping_address":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"},"shipping_method_code":"flatrate","shipping_carrier_code":"flatrate"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/shipping-information - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_billing_shipping_information.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - {"payment_methods": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"cartId":"${cart_id}","email":"test@example.com","paymentMethod":{"method":"checkmo","po_number":null,"additional_data":null},"billingAddress":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/payment-information - POST - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_payment_info_place_order.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "[0-9]+" - - Assertion.response_data - false - 2 - - - - order_id - $ - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/onepage/success/ - GET - true - false - true - false - false - - tool/fragments/ce/guest_checkout/checkout_success.jmx - - - - Thank you for your purchase! - Your order # is - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${cCheckoutByCustomerPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Checkout By Customer"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - tool/fragments/ce/common/init_total_products_in_cart_setup.jmx - -vars.put("totalProductsAdded", "0"); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/login/ - GET - true - false - true - false - false - - tool/fragments/ce/common/open_login_page.jmx - - - - <title>Customer Login</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${customer_email} - = - true - login[username] - - - true - ${customer_password} - = - true - login[password] - - - true - - = - true - send - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/loginPost/ - POST - true - false - true - false - false - - tool/fragments/ce/common/login.jmx - - - - <title>My Account</title> - - Assertion.response_data - false - 2 - - - - false - addressId - customer/address/edit/id/([^'"]+)/ - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - addressId - - - - - - - - true - - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_category.jmx - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_product_add_to_cart.jmx - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - tool/fragments/ce/loops/update_products_added_counter.jmx - -productsAdded = Integer.parseInt(vars.get("totalProductsAdded")); -productsAdded = productsAdded + 1; - -vars.put("totalProductsAdded", String.valueOf(productsAdded)); - - - - true - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${product_url_key}${url_suffix} - GET - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/product_view.jmx - - - - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - true - 1 - tool/fragments/ce/common/get_configurable_product_options.jmx - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - true - ${product_id} - = - true - product - - - true - - = - true - related_product - - - true - 1 - = - true - qty - - - true - ${form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_product_add_to_cart.jmx - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - tool/fragments/ce/common/configurable_product_add_to_cart_preprocessor.jmx - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - tool/fragments/ce/load_cart_section.jmx - - - - You added ${product_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":${totalProductsAdded} - - Assertion.response_data - false - 2 - - - - - - - X-Requested-With - XMLHttpRequest - - - tool/fragments/ce/common/http_header_manager_ajax.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/ - GET - true - false - true - false - false - - tool/fragments/ce/customer_checkout/checkout_start.jmx - - - - <title>Checkout</title> - - Assertion.response_data - false - 2 - - - - - <title>Shopping Cart</title> - - Assertion.response_data - false - 6 - - - - false - cart_id - "quoteData":{"entity_id":"([^'"]+)", - $1$ - - 1 - - - - false - address_id - "default_billing":"([^'"]+)", - $1$ - - 1 - - - - false - customer_id - "customer_id":([^'",]+), - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - - [0-9]+$ - - Assertion.response_data - false - 1 - variable - address_id - - - - - [0-9]+$ - - Assertion.response_data - false - 1 - variable - customer_id - - - - - - true - - - - false - {"addressId":"${addressId}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id - POST - true - false - true - false - false - - tool/fragments/ce/customer_checkout/checkout_estimate_shipping_methods.jmx - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "available":true - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"addressInformation":{"shipping_address":{"customerAddressId":"${address_id}","countryId":"US","regionId":"${alabama_region_id}","regionCode":"AL","region":"Alabama","customerId":"${customer_id}","street":["123 Freedom Blvd. #123"],"telephone":"022-333-4455","postcode":"123123","city":"Fayetteville","firstname":"Anthony","lastname":"Nealy"},"shipping_method_code":"flatrate","shipping_carrier_code":"flatrate"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/shipping-information - POST - true - false - true - false - false - - tool/fragments/ce/customer_checkout/checkout_billing_shipping_information.jmx - - - - - Referer - ${host}${base_path}checkout/onepage - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - {"payment_methods" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"cartId":"${cart_id}","paymentMethod":{"method":"checkmo","po_number":null,"additional_data":null},"billingAddress":{"customerAddressId":"${address_id}","countryId":"US","regionId":"${alabama_region_id}","regionCode":"AL","region":"Alabama","customerId":"${customer_id}","street":["123 Freedom Blvd. #123"],"telephone":"022-333-4455","postcode":"123123","city":"Fayetteville","firstname":"Anthony","lastname":"Nealy"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/payment-information - POST - true - false - true - false - false - - tool/fragments/ce/customer_checkout/checkout_payment_info_place_order.jmx - - - - - Referer - ${host}${base_path}checkout/onepage - - - Content-Type - application/json; charset=UTF-8 - - - Accept - application/json - - - X-Requested-With - XMLHttpRequest - - - - - - - "[0-9]+" - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}checkout/onepage/success/ - GET - true - false - true - false - false - - tool/fragments/ce/customer_checkout/checkout_success.jmx - - - - Thank you for your purchase! - Your order number is - - Assertion.response_data - false - 2 - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/common/logout.jmx - - - - You are signed out. - - Assertion.response_data - false - 2 - - - - - false - - - curSampler = ctx.getCurrentSampler(); -if(curSampler.getName().contains("Checkout success")) { - manager = curSampler.getCookieManager(); - manager.clear(); -} - - tool/fragments/ce/customer_checkout/checkout_clear_cookie.jmx - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAccountManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Account management"); - - true - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - ${form_key} - ${host} - ${base_path} - false - 0 - true - true - - - true - tool/fragments/ce/http_cookie_manager.jmx - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - tool/fragments/ce/common/open_home_page.jmx - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/login/ - GET - true - false - true - false - false - - tool/fragments/ce/common/open_login_page.jmx - - - - <title>Customer Login</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${customer_email} - = - true - login[username] - - - true - ${customer_password} - = - true - login[password] - - - true - - = - true - send - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/loginPost/ - POST - true - false - true - false - false - - tool/fragments/ce/common/login.jmx - - - - <title>My Account</title> - - Assertion.response_data - false - 2 - - - - false - addressId - customer/address/edit/id/([^'"]+)/ - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - addressId - - - - - - - - true - - = - true - sections - - - true - false - = - true - force_new_section_timestamp - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}sales/order/history/ - GET - true - false - true - false - false - - tool/fragments/ce/account_management/my_orders.jmx - - - - <title>My Orders</title> - - Assertion.response_data - false - 2 - - - - false - orderId - sales/order/view/order_id/(\d+)/ - $1$ - NOT_FOUND - 1 - - - - - - tool/fragments/ce/account_management/if_orders.jmx - "${orderId}" != "NOT_FOUND" - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}sales/order/view/order_id/${orderId} - GET - true - false - true - false - false - - - - - - <title>Order # - - Assertion.response_data - false - 2 - - - - false - shipment_tab - sales/order/shipment/order_id/(\d+)..Order Shipments - $1$ - NOT_FOUND - 1 - - - - - May not have shipped - "${shipment_tab}" != "NOT_FOUND" - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}sales/order/shipment/order_id/${orderId} - GET - true - false - true - false - false - - - - - - Track this shipment - - Assertion.response_data - false - 2 - - - - false - popupLink - popupWindow": {"windowURL":"([^'"]+)", - $1$ - - 1 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${popupLink} - GET - true - false - true - false - false - - - - - - <title>Tracking Information</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}downloadable/customer/products - GET - true - false - true - false - false - - tool/fragments/ce/account_management/my_downloadable_products.jmx - - - - <title>My Downloadable Products</title> - - Assertion.response_data - false - 2 - - - - false - orderId - sales/order/view/order_id/(\d+)/ - $1$ - NOT_FOUND - 1 - - - - false - linkId - downloadable/download/link/id/(\d+)/ - $1$ - - 1 - - - - - - tool/fragments/ce/account_management/if_downloadables.jmx - "${orderId}" != "NOT_FOUND" - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}sales/order/view/order_id/${orderId} - GET - true - false - true - false - false - - tool/fragments/ce/account_management/view_downloadable_products.jmx - - - - <title>Order # - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}downloadable/download/link/id/${linkId} - GET - true - false - true - false - false - - tool/fragments/ce/account_management/download_product.jmx - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}wishlist - GET - true - false - true - false - false - - - - - - <title>My Wish List</title> - - Assertion.response_data - false - 2 - - - - false - wishlistId - wishlist/index/update/wishlist_id/([^'"]+)/ - $1$ - - 1 - tool/fragments/ce/account_management/my_wish_list.jmx - - - - false - buttonTitle - Update Wish List - FOUND - NOT_FOUND - 1 - - - - - - tool/fragments/ce/account_management/if_wishlist.jmx - "${buttonTitle}" === "FOUND" - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}wishlist/index/share/wishlist_id/${wishlistId}/ - GET - true - false - true - false - false - - tool/fragments/ce/account_management/share_wish_list.jmx - - - - <title>Wish List Sharing</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ${form_key} - = - true - form_key - true - - - true - ${customer_email} - = - true - emails - - - true - [TEST] See my wishlist!!! - = - true - message - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}wishlist/index/send/wishlist_id/${wishlistId}/ - POST - true - false - true - false - false - - tool/fragments/ce/account_management/send_wish_list.jmx - - - - <title>My Wish List</title> - - Assertion.response_data - false - 2 - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}customer/account/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/common/logout.jmx - - - - You are signed out. - - Assertion.response_data - false - 2 - - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminCMSManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin CMS Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_cms_management/admin_cms_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/ - GET - true - false - true - false - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/new - GET - true - false - true - false - false - - - - - - - - true - <p>CMS Content ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - content - - - true - - = - true - content_heading - - - true - ${admin_form_key} - = - true - form_key - - - true - - = - true - identifier - - - true - 1 - = - true - is_active - - - true - - = - true - layout_update_xml - - - true - - = - true - meta_description - - - true - - = - true - meta_keywords - - - true - - = - true - meta_title - - - false - {} - = - true - nodes_data - - - true - - = - true - node_ids - - - true - - = - true - page_id - - - true - 1column - = - true - page_layout - - - true - 0 - = - true - store_id[0] - - - true - CMS Title ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - title - - - true - 0 - = - true - website_root - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/save/ - POST - true - false - true - false - false - - - - - - You saved the page. - - Assertion.response_data - false - 16 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCMSManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminBrowseProductGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Browse Product Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Product"); - - pagesCount = parseInt(vars.get("products_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "product_listing"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_product_filter_text")); - vars.put("grid_filter_field", "name"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "name"); - vars.put("grid_sort_field_2", "price"); - vars.put("grid_sort_field_3", "attribute_set_id"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_products_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminBrowseOrderGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Browse Order Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Order"); - - pagesCount = parseInt(vars.get("orders_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "sales_order_grid"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_orders_filter_text")); - vars.put("grid_filter_field", "status"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "increment_id"); - vars.put("grid_sort_field_2", "created_at"); - vars.put("grid_sort_field_3", "billing_name"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_orders_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminProductCreationPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Create Product"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/once_only_controller.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(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom}); -} -relatedIndex = random.nextInt(props.get("simple_products_list").size()); -vars.put("related_product_id", props.get("simple_products_list").get(relatedIndex).get("id")); - - - true - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - - - - false - mycolor - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - false - attribute_code - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - false - mysize - = - true - searchCriteria[filterGroups][0][filters][1][value] - - - false - attribute_code - = - true - searchCriteria[filterGroups][0][filters][1][field] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/attributes - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/get_product_attributes.jmx - - - product_attributes - $.items - - - BODY - - - - javascript - - - - -var attributesData = JSON.parse(vars.get("product_attributes")), -maxOptions = 2; - -attributes = []; -for (i in attributesData) { - if (i >= 2) { - break; - } - var data = attributesData[i], - attribute = { - "id": data.attribute_id, - "code": data.attribute_code, - "label": data.default_frontend_label, - "options": [] - }; - - var processedOptions = 0; - for (optionN in data.options) { - var option = data.options[optionN]; - if (parseInt(option.value) > 0 && processedOptions < maxOptions) { - processedOptions++; - attribute.options.push(option); - } - } - attributes.push(attribute); -} - -vars.putObject("product_attributes", attributes); - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product_set/index/filter/${attribute_set_filter} - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx - - - - false - attribute_set_id - catalog&#x2F;product_set&#x2F;edit&#x2F;id&#x2F;([\d]+)&#x2F;"[\D\d]*Attribute Set 1 - $1$ - - 1 - - - - false - - - import org.apache.commons.codec.binary.Base64; - -byte[] encodedBytes = Base64.encodeBase64("set_name=Attribute Set 1".getBytes()); -vars.put("attribute_set_filter", new String(encodedBytes)); - - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - 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()); - -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")); - -do { - number1 = random.nextInt(props.get("simple_products_list_for_edit").size()); -} while(number == number1); -simpleList = props.get("simple_products_list_for_edit").get(number1); -vars.put("simple_product_2_id", simpleList.get("id")); -vars.put("simple_product_2_name", simpleList.get("title")); - -number2 = random.nextInt(props.get("configurable_products_list").size()); -configurableList = props.get("configurable_products_list").get(number2); -vars.put("configurable_product_1_id", configurableList.get("id")); -vars.put("configurable_product_1_url_key", configurableList.get("url_key")); -vars.put("configurable_product_1_name", configurableList.get("title")); - -//Additional category to be added -//int categoryId = Integer.parseInt(vars.get("simple_product_category_id")); -//vars.put("category_additional", (categoryId+1).toString()); -//New price -vars.put("price_new", "9999"); -//New special price -vars.put("special_price_new", "8888"); -//New quantity -vars.put("quantity_new", "100600"); -vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNum}-${__Random(1,1000000)}"); - - - - - true - tool/fragments/ce/admin_create_product/setup.jmx - - - - tool/fragments/ce/admin_create_product/create_bundle_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/bundle/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 42 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[configurable_variations] - - - true - 1 - = - true - affect_configurable_product_attributes - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - new-variations-attribute-set-id - - - true - 0 - = - true - product[shipment_type] - - - true - option title one - = - true - bundle_options[bundle_options][0][title] - - - true - - = - true - bundle_options[bundle_options][0][option_id] - - - true - - = - true - bundle_options[bundle_options][0][delete] - - - true - select - = - true - bundle_options[bundle_options][0][type] - - - true - 1 - = - true - bundle_options[bundle_options][0][required] - - - true - 0 - = - true - bundle_options[bundle_options][0][position] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][option_id] - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][0][bundle_selections][0][product_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][delete] - - - true - 25 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_value] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_type] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty] - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][0][position] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][option_id] - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][0][bundle_selections][1][product_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][delete] - - - true - 10.99 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_value] - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_type] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][position] - - - true - option title two - = - true - bundle_options[bundle_options][1][title] - - - true - - = - true - bundle_options[bundle_options][1][option_id] - - - true - - = - true - bundle_options[bundle_options][1][delete] - - - true - select - = - true - bundle_options[bundle_options][1][type] - - - true - 1 - = - true - bundle_options[bundle_options][1][required] - - - true - 1 - = - true - bundle_options[bundle_options][1][position] - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][option_id] - true - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][1][bundle_selections][0][product_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][delete] - true - - - true - 5.00 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_value] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_type] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][position] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][option_id] - true - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][1][bundle_selections][1][product_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][delete] - true - - - true - 7.00 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_value] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_type] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][position] - true - - - true - 2 - = - true - affect_bundle_product_selections - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 42 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full bundle product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[configurable_variations] - - - true - 1 - = - true - affect_configurable_product_attributes - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - new-variations-attribute-set-id - - - true - 0 - = - true - product[shipment_type] - false - - - true - option title one - = - true - bundle_options[bundle_options][0][title] - false - - - true - - = - true - bundle_options[bundle_options][0][option_id] - false - - - true - - = - true - bundle_options[bundle_options][0][delete] - false - - - true - select - = - true - bundle_options[bundle_options][0][type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][required] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][position] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][option_id] - false - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][0][bundle_selections][0][product_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][delete] - false - - - true - 25 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_value] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][0][position] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][option_id] - false - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][0][bundle_selections][1][product_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][delete] - false - - - true - 10.99 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][position] - false - - - true - option title two - = - true - bundle_options[bundle_options][1][title] - false - - - true - - = - true - bundle_options[bundle_options][1][option_id] - false - - - true - - = - true - bundle_options[bundle_options][1][delete] - false - - - true - select - = - true - bundle_options[bundle_options][1][type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][required] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][position] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][option_id] - false - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][1][bundle_selections][0][product_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][delete] - false - - - true - 5.00 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][position] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][option_id] - false - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][1][bundle_selections][1][product_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][delete] - false - - - true - 7.00 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][position] - false - - - true - 2 - = - true - affect_bundle_product_selections - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/bundle/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - option title one - option title two - ${simple_product_2_name} - ${simple_product_1_name} - - - Assertion.response_data - false - 2 - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/open_catalog_grid.jmx - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/${attribute_set_id}/type/configurable/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/new_configurable.jmx - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - ${admin_form_key} - = - true - form_key - true - - - true - ${attribute_set_id} - = - true - new-variations-attribute-set-id - true - - - true - 1 - = - true - product[affect_product_custom_options] - true - - - true - ${attribute_set_id} - = - true - product[attribute_set_id] - true - - - true - 4 - = - true - product[category_ids][0] - true - - - true - - = - true - product[custom_layout_update] - true - - - true - - = - true - product[description] - true - - - true - 0 - = - true - product[gift_message_available] - true - - - true - 1 - = - true - product[gift_wrapping_available] - true - - - true - - = - true - product[gift_wrapping_price] - true - - - true - - = - true - product[image] - true - - - true - 2 - = - true - product[is_returnable] - true - - - true - ${configurable_sku} - Meta Description - = - true - product[meta_description] - true - - - true - ${configurable_sku} - Meta Keyword - = - true - product[meta_keyword] - true - - - true - ${configurable_sku} - Meta Title - = - true - product[meta_title] - true - - - true - ${configurable_sku} - = - true - product[name] - true - - - true - container2 - = - true - product[options_container] - true - - - true - ${price_new} - = - true - product[price] - true - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - true - - - true - 1000 - = - true - product[quantity_and_stock_status][qty] - true - - - true - - = - true - product[short_description] - true - - - true - ${configurable_sku} - = - true - product[sku] - true - - - true - - = - true - product[small_image] - true - - - true - ${special_price_new} - = - true - product[special_price] - true - - - true - 1 - = - true - product[status] - true - - - true - 0 - = - true - product[stock_data][backorders] - true - - - true - 1 - = - true - product[stock_data][deferred_stock_update] - true - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - true - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - true - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - true - - - true - 1 - = - true - product[stock_data][manage_stock] - true - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - true - - - true - 0 - = - true - product[stock_data][min_qty] - true - - - true - 1 - = - true - product[stock_data][min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_backorders] - true - - - true - 1 - = - true - product[stock_data][use_config_deferred_stock_update] - true - - - true - 1 - = - true - product[stock_data][use_config_enable_qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - true - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - true - - - true - 2 - = - true - product[tax_class_id] - true - - - true - - = - true - product[thumbnail] - true - - - true - - = - true - product[url_key] - true - - - true - 1 - = - true - product[use_config_gift_message_available] - true - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - true - - - true - 1 - = - true - product[use_config_is_returnable] - true - - - true - 4 - = - true - product[visibility] - true - - - true - 1 - = - true - product[website_ids][1] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/${attribute_set_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_validate.jmx - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - javascript - - - - -attributes = vars.getObject("product_attributes"); - -for (i in attributes) { - var attribute = attributes[i]; - sampler.addArgument("attribute_codes[" + i + "]", attribute.code); - sampler.addArgument("attributes[" + i + "]", attribute.id); - sampler.addArgument("product[" + attribute.code + "]", attribute.options[0].value); - addConfigurableAttributeData(attribute); -} - -addConfigurableMatrix(attributes); - -function addConfigurableAttributeData(attribute) { - var attributeId = attribute.id; - - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attribute.code); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attribute.label); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][position]", 0); - attribute.options.forEach(function (option, index) { - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][include]", index); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][value_index]", option.value); - }); -} - -/** - * Build 4 simple products for Configurable - */ -function addConfigurableMatrix(attributes) { - - var attribute1 = attributes[0], - attribute2 = attributes[1], - productIndex = 1, - products = []; - var variationNames = []; - attribute1.options.forEach(function (option1) { - attribute2.options.forEach(function (option2) { - var productAttributes = {}, - namePart = option1.label + "+" + option2.label, - variationKey = option1.value + "-" + option2.value; - productAttributes[attribute1.code] = option1.value; - productAttributes[attribute2.code] = option2.value; - - variationNames.push(namePart + " - " + vars.get("configurable_sku")); - var product = { - "id": null, - "name": namePart + " - " + vars.get("configurable_sku"), - "sku": namePart + " - " + vars.get("configurable_sku"), - "status": 1, - "price": "100", - "price_currency": "$", - "price_string": "$100", - "weight": "6", - "qty": "50", - "variationKey": variationKey, - "configurable_attribute": JSON.stringify(productAttributes), - "thumbnail_image": "", - "media_gallery": {"images": {}}, - "image": [], - "was_changed": true, - "canEdit": 1, - "newProduct": 1, - "record_id": productIndex - }; - productIndex++; - products.push(product); - }); - }); - - sampler.addArgument("configurable-matrix-serialized", JSON.stringify(products)); - vars.putObject("configurable_variations_assertion", variationNames); -} - - tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - ${admin_form_key} - = - true - form_key - true - - - true - ${attribute_set_id} - = - true - new-variations-attribute-set-id - true - - - true - 1 - = - true - product[affect_product_custom_options] - true - - - true - ${attribute_set_id} - = - true - product[attribute_set_id] - true - - - true - 2 - = - true - product[category_ids][0] - true - - - true - - = - true - product[custom_layout_update] - true - - - true - - = - true - product[description] - true - - - true - 0 - = - true - product[gift_message_available] - true - - - true - 1 - = - true - product[gift_wrapping_available] - true - - - true - - = - true - product[gift_wrapping_price] - true - - - true - - = - true - product[image] - true - - - true - 2 - = - true - product[is_returnable] - true - - - true - ${configurable_sku} - Meta Description - = - true - product[meta_description] - true - - - true - ${configurable_sku} - Meta Keyword - = - true - product[meta_keyword] - true - - - true - ${configurable_sku} - Meta Title - = - true - product[meta_title] - true - - - true - ${configurable_sku} - = - true - product[name] - true - - - true - container2 - = - true - product[options_container] - true - - - true - ${price_new} - = - true - product[price] - true - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - true - - - true - 1000 - = - true - product[quantity_and_stock_status][qty] - true - - - true - - = - true - product[short_description] - true - - - true - ${configurable_sku} - = - true - product[sku] - true - - - true - - = - true - product[small_image] - true - - - true - ${special_price_new} - = - true - product[special_price] - true - - - true - 1 - = - true - product[status] - true - - - true - 0 - = - true - product[stock_data][backorders] - true - - - true - 1 - = - true - product[stock_data][deferred_stock_update] - true - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - true - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - true - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - true - - - true - 1 - = - true - product[stock_data][manage_stock] - true - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - true - - - true - 0 - = - true - product[stock_data][min_qty] - true - - - true - 1 - = - true - product[stock_data][min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_backorders] - true - - - true - 1 - = - true - product[stock_data][use_config_deferred_stock_update] - true - - - true - 1 - = - true - product[stock_data][use_config_enable_qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - true - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - true - - - true - 2 - = - true - product[tax_class_id] - true - - - true - - = - true - product[thumbnail] - true - - - true - - = - true - product[url_key] - true - - - true - 1 - = - true - product[use_config_gift_message_available] - true - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - true - - - true - 1 - = - true - product[use_config_is_returnable] - true - - - true - 4 - = - true - product[visibility] - true - - - true - 1 - = - true - product[website_ids][1] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/${attribute_set_id}/type/configurable/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_save.jmx - - - - You saved the product - - Assertion.response_data - false - 2 - - - - javascript - - - - -var configurableVariations = vars.getObject("configurable_variations_assertion"), -response = SampleResult.getResponseDataAsString(); - -configurableVariations.forEach(function (variation) { - if (response.indexOf(variation) == -1) { - AssertionResult.setFailureMessage("Cannot find variation \"" + variation + "\""); - AssertionResult.setFailure(true); - } -}); - - - - - - javascript - - - - -attributes = vars.getObject("product_attributes"); - -for (i in attributes) { - var attribute = attributes[i]; - sampler.addArgument("attribute_codes[" + i + "]", attribute.code); - sampler.addArgument("attributes[" + i + "]", attribute.id); - sampler.addArgument("product[" + attribute.code + "]", attribute.options[0].value); - addConfigurableAttributeData(attribute); -} - -addConfigurableMatrix(attributes); - -function addConfigurableAttributeData(attribute) { - var attributeId = attribute.id; - - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attribute.code); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attribute.label); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][position]", 0); - attribute.options.forEach(function (option, index) { - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][include]", index); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][value_index]", option.value); - }); -} - -/** - * Build 4 simple products for Configurable - */ -function addConfigurableMatrix(attributes) { - - var attribute1 = attributes[0], - attribute2 = attributes[1], - productIndex = 1, - products = []; - var variationNames = []; - attribute1.options.forEach(function (option1) { - attribute2.options.forEach(function (option2) { - var productAttributes = {}, - namePart = option1.label + "+" + option2.label, - variationKey = option1.value + "-" + option2.value; - productAttributes[attribute1.code] = option1.value; - productAttributes[attribute2.code] = option2.value; - - variationNames.push(namePart + " - " + vars.get("configurable_sku")); - var product = { - "id": null, - "name": namePart + " - " + vars.get("configurable_sku"), - "sku": namePart + " - " + vars.get("configurable_sku"), - "status": 1, - "price": "100", - "price_currency": "$", - "price_string": "$100", - "weight": "6", - "qty": "50", - "variationKey": variationKey, - "configurable_attribute": JSON.stringify(productAttributes), - "thumbnail_image": "", - "media_gallery": {"images": {}}, - "image": [], - "was_changed": true, - "canEdit": 1, - "newProduct": 1, - "record_id": productIndex - }; - productIndex++; - products.push(product); - }); - }); - - sampler.addArgument("configurable-matrix-serialized", JSON.stringify(products)); - vars.putObject("configurable_variations_assertion", variationNames); -} - - tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx - - - - - - tool/fragments/ce/admin_create_product/create_downloadable_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/downloadable/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - ${files_folder}downloadable_original.txt - links - text/plain - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/downloadable_file/upload/type/links/?isAjax=true - POST - false - false - true - true - false - - - - - original_file - $.file - - - BODY - - - - - - - - ${files_folder}downloadable_sample.txt - samples - text/plain - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/downloadable_file/upload/type/samples/?isAjax=true - POST - false - false - true - true - false - - - - - sample_file - $.file - - - BODY - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - on - = - true - is_downloadable - - - true - Links - = - true - product[links_title] - - - true - 0 - = - true - product[links_purchased_separately] - - - true - ${original_file} - = - true - downloadable[link][0][file][0][file] - false - - - true - downloadable_original.txt - = - true - downloadable[link][0][file][0][name] - false - - - true - 13 - = - true - downloadable[link][0][file][0][size] - false - - - true - new - = - true - downloadable[link][0][file][0][status] - false - - - true - 1 - = - true - downloadable[link][0][is_shareable] - - - true - 0 - = - true - downloadable[link][0][is_unlimited] - - - true - - = - true - downloadable[link][0][link_url] - - - true - 0 - = - true - downloadable[link][0][number_of_downloads] - true - - - true - 120 - = - true - downloadable[link][0][price] - true - - - true - 0 - = - true - downloadable[link][0][record_id] - true - - - true - file - = - true - downloadable[link][0][sample][type] - - - true - - = - true - downloadable[link][0][sample][url] - - - true - 1 - = - true - downloadable[link][0][sort_order] - - - true - Original Link - = - true - downloadable[link][0][title] - - - true - file - = - true - downloadable[link][0][type] - - - true - ${sample_file} - = - true - downloadable[sample][0][file][0][file] - true - - - true - downloadable_sample.txt - = - true - downloadable[sample][0][file][0][name] - true - - - true - 14 - = - true - downloadable[sample][0][file][0][size] - true - - - true - new - = - true - downloadable[sample][0][file][0][status] - true - - - true - 0 - = - true - downloadable[sample][0][record_id] - true - - - true - - = - true - downloadable[sample][0][sample_url] - true - - - true - 1 - = - true - downloadable[sample][0][sort_order] - true - - - true - Sample Link - = - true - downloadable[sample][0][title] - true - - - true - file - = - true - downloadable[sample][0][type] - true - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - 4 - = - true - new-variations-attribute-set-id - false - - - true - - = - true - product[configurable_variation] - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/type/downloadable/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - false - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - ${original_file} - = - true - downloadable[link][0][file][0][file] - false - - - true - downloadable_original.txt - = - true - downloadable[link][0][file][0][name] - false - - - true - 13 - = - true - downloadable[link][0][file][0][size] - false - - - true - new - = - true - downloadable[link][0][file][0][status] - false - - - true - 1 - = - true - downloadable[link][0][is_shareable] - true - - - true - 0 - = - true - downloadable[link][0][is_unlimited] - true - - - true - - = - true - downloadable[link][0][link_url] - true - - - true - 0 - = - true - downloadable[link][0][number_of_downloads] - false - - - true - 120 - = - true - downloadable[link][0][price] - false - - - true - 0 - = - true - downloadable[link][0][record_id] - false - - - true - file - = - true - downloadable[link][0][sample][type] - true - - - true - - = - true - downloadable[link][0][sample][url] - true - - - true - 1 - = - true - downloadable[link][0][sort_order] - true - - - true - Original Link - = - true - downloadable[link][0][title] - true - - - true - file - = - true - downloadable[link][0][type] - true - - - true - ${sample_file} - = - true - downloadable[sample][0][file][0][file] - true - - - true - downloadable_sample.txt - = - true - downloadable[sample][0][file][0][name] - true - - - true - 14 - = - true - downloadable[sample][0][file][0][size] - true - - - true - new - = - true - downloadable[sample][0][file][0][status] - true - - - true - 0 - = - true - downloadable[sample][0][record_id] - true - - - true - - = - true - downloadable[sample][0][sample_url] - true - - - true - 1 - = - true - downloadable[sample][0][sort_order] - true - - - true - Sample Link - = - true - downloadable[sample][0][title] - true - - - true - file - = - true - downloadable[sample][0][type] - true - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - 4 - = - true - new-variations-attribute-set-id - false - - - true - - = - true - product[configurable_variation] - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/downloadable/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - violation - - Assertion.response_data - false - 6 - - - - - - - tool/fragments/ce/admin_create_product/create_simple_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/simple/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - product[options][1][is_delete] - false - - - true - 1 - = - true - product[options][1][is_require] - false - - - true - select - = - true - product[options][1][previous_group] - false - - - true - drop_down - = - true - product[options][1][previous_type] - false - - - true - 0 - = - true - product[options][1][sort_order] - false - - - true - Product Option Title One - = - true - product[options][1][title] - false - - - true - drop_down - = - true - product[options][1][type] - false - - - true - - = - true - product[options][1][values][1][is_delete] - false - - - true - 200 - = - true - product[options][1][values][1][price] - false - - - true - fixed - = - true - product[options][1][values][1][price_type] - false - - - true - sku-one - = - true - product[options][1][values][1][sku] - false - - - true - 0 - = - true - product[options][1][values][1][sort_order] - false - - - true - Row Title - = - true - product[options][1][values][1][title] - false - - - true - - = - true - product[options][2][is_delete] - false - - - true - 1 - = - true - product[options][2][is_require] - false - - - true - 250 - = - true - product[options][2][max_characters] - false - - - true - text - = - true - product[options][2][previous_group] - false - - - true - field - = - true - product[options][2][previous_type] - false - - - true - 500 - = - true - product[options][2][price] - false - - - true - fixed - = - true - product[options][2][price_type] - false - - - true - sku-two - = - true - product[options][2][sku] - false - - - true - 1 - = - true - product[options][2][sort_order] - false - - - true - Field Title - = - true - product[options][2][title] - false - - - true - field - = - true - product[options][2][type] - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - 4 - = - true - new-variations-attribute-set-id - true - - - true - - = - true - product[configurable_variation] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full simple product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - product[options][1][is_delete] - true - - - true - 1 - = - true - product[options][1][is_require] - - - true - select - = - true - product[options][1][previous_group] - false - - - true - drop_down - = - true - product[options][1][previous_type] - false - - - true - 0 - = - true - product[options][1][sort_order] - false - - - true - Product Option Title One - = - true - product[options][1][title] - - - true - drop_down - = - true - product[options][1][type] - - - true - - = - true - product[options][1][values][1][is_delete] - false - - - true - 200 - = - true - product[options][1][values][1][price] - - - true - fixed - = - true - product[options][1][values][1][price_type] - - - true - sku-one - = - true - product[options][1][values][1][sku] - - - true - 0 - = - true - product[options][1][values][1][sort_order] - - - true - Row Title - = - true - product[options][1][values][1][title] - - - true - - = - true - product[options][2][is_delete] - false - - - true - 1 - = - true - product[options][2][is_require] - - - true - 250 - = - true - product[options][2][max_characters] - - - true - text - = - true - product[options][2][previous_group] - - - true - field - = - true - product[options][2][previous_type] - - - true - 500 - = - true - product[options][2][price] - - - true - fixed - = - true - product[options][2][price_type] - - - true - sku-two - = - true - product[options][2][sku] - - - true - 1 - = - true - product[options][2][sort_order] - - - true - Field Title - = - true - product[options][2][title] - - - true - field - = - true - product[options][2][type] - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - 4 - = - true - new-variations-attribute-set-id - true - - - true - - = - true - product[configurable_variation] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/simple/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - violation - - Assertion.response_data - false - 6 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminProductEditingPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Edit Product"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.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) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - simpleCount = props.get("simple_products_list_for_edit").size(); - configCount = props.get("configurable_products_list_for_edit").size(); - productCount = 0; - if (simpleCount > configCount) { - productCount = configCount; - } else { - productCount = simpleCount; - } - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - threadsNumber = 1; - } - //Current thread number starts from 0 - currentThreadNum = ctx.getThreadNum(); - - String siterator = vars.get("threadIterator_" + currentThreadNum.toString()); - iterator = 0; - if(siterator == null){ - vars.put("threadIterator_" + currentThreadNum.toString() , "0"); - } else { - iterator = Integer.parseInt(siterator); - iterator ++; - vars.put("threadIterator_" + currentThreadNum.toString() , iterator.toString()); - } - - //Number of products for one thread - productClusterLength = productCount / threadsNumber; - - if (iterator >= productClusterLength) { - vars.put("threadIterator_" + currentThreadNum.toString(), "0"); - iterator = 0; - } - - //Index of the current product from the cluster - i = productClusterLength * currentThreadNum + iterator; - - //ids of simple and configurable products to edit - vars.put("simple_product_id", props.get("simple_products_list_for_edit").get(i).get("id")); - vars.put("configurable_product_id", props.get("configurable_products_list_for_edit").get(i).get("id")); - - //id of related product - do { - relatedIndex = random.nextInt(props.get("simple_products_list_for_edit").size()); - } while(i == relatedIndex); - vars.put("related_product_id", props.get("simple_products_list_for_edit").get(relatedIndex).get("id")); - } catch (Exception ex) { - log.info("Script execution failed", ex); -} - - - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/edit/id/${simple_product_id}/ - GET - true - false - true - false - false - - - - - - Product - - Assertion.response_data - false - 16 - - - - false - simple_product_name - ,"name":"([^'"]+)", - $1$ - - 1 - - - - false - simple_product_sku - ,"sku":"([^'"]+)", - $1$ - - 1 - - - - false - simple_product_category_id - ,"category_ids":."(\d+)". - $1$ - - 1 - - - - - Passing arguments between threads - //Additional category to be added - import java.util.Random; - - Random randomGenerator = new Random(); - int newCategoryId; - if (${seedForRandom} > 0) { - randomGenerator.setSeed(${seedForRandom} + ${__threadNum}); - } - - int categoryId = Integer.parseInt(vars.get("simple_product_category_id")); - categoryList = props.get("admin_category_ids_list"); - - if (categoryList.size() > 1) { - do { - int index = randomGenerator.nextInt(categoryList.size()); - newCategoryId = Integer.parseInt(categoryList.get(index)); - } while (categoryId == newCategoryId); - - vars.put("category_additional", newCategoryId.toString()); - } - - //New price - vars.put("price_new", "9999"); - //New special price - vars.put("special_price_new", "8888"); - //New quantity - vars.put("quantity_new", "100600"); - - - - false - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${simple_product_name} - = - true - product[name] - false - - - true - ${simple_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - ${quantity_new} - = - true - product[quantity_and_stock_status][qty] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 1.0000 - = - true - product[weight] - false - - - true - 1 - = - true - product[product_has_weight] - false - - - true - ${simple_product_category_id} - = - true - product[category_ids][] - false - - - true - <p>Full simple product Description ${simple_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - - = - true - product[configurable_variations] - false - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - - = - true - product[image] - false - - - true - - = - true - product[small_image] - false - - - true - - = - true - product[thumbnail] - false - - - true - ${simple_product_name} - = - true - product[url_key] - false - - - true - ${simple_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${simple_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${simple_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - ${quantity_new} - = - true - product[stock_data][original_inventory_qty] - false - - - true - ${quantity_new} - = - true - product[stock_data][qty] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - - = - true - new-variations-attribute-set-id - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/id/${simple_product_id}/?isAjax=true - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${simple_product_name} - = - true - product[name] - false - - - true - ${simple_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - ${quantity_new} - = - true - product[quantity_and_stock_status][qty] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 1.0000 - = - true - product[weight] - false - - - true - 1 - = - true - product[product_has_weight] - false - - - true - ${simple_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - - - true - <p>Full simple product Description ${simple_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - - = - true - product[configurable_variations] - false - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - - = - true - product[image] - false - - - true - - = - true - product[small_image] - false - - - true - - = - true - product[thumbnail] - false - - - true - ${simple_product_name} - = - true - product[url_key] - false - - - true - ${simple_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${simple_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${simple_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - ${quantity_new} - = - true - product[stock_data][original_inventory_qty] - false - - - true - ${quantity_new} - = - true - product[stock_data][qty] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - - = - true - new-variations-attribute-set-id - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/id/${simple_product_id}/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/edit/id/${configurable_product_id}/ - GET - true - false - true - false - false - - - - - - Product - - Assertion.response_data - false - 16 - - - - false - configurable_product_name - ,"name":"([^'"]+)", - $1$ - - 1 - - - - false - configurable_product_sku - ,"sku":"([^'"]+)", - $1$ - - 1 - - - - false - configurable_product_category_id - ,"category_ids":."(\d+)" - $1$ - - 1 - - - - false - configurable_attribute_id - ,"configurable_variation":"([^'"]+)", - $1$ - - 1 - true - - - - false - configurable_matrix - "configurable-matrix":(\[.*?\]) - $1$ - - 1 - true - - - - associated_products_ids - $.[*].id - - configurable_matrix - VAR - - - - false - configurable_product_data - (\{"product":.*?configurable_attributes_data.*?\})\s*< - $1$ - - 1 - - - - configurable_attributes_data - $.product.configurable_attributes_data - - configurable_product_data - VAR - - - - false - configurable_attribute_ids - "attribute_id":"(\d+)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_codes - "code":"(\w+)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_labels - "label":"(.*?)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_values - "values":(\{(?:\}|.*?\}\})) - $1$ - - -1 - variable - configurable_attributes_data - - - - - configurable_attribute_ids - configurable_attribute_id - true - - - - 1 - ${configurable_attribute_ids_matchNr} - 1 - attribute_counter - - true - true - - - - return vars.get("configurable_attribute_values_" + vars.get("attribute_counter")); - - - false - - - - false - attribute_${configurable_attribute_id}_values - "value_index":"(\d+)" - $1$ - - -1 - configurable_attribute_values_${attribute_counter} - - - - - - - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${configurable_product_name} - = - true - product[name] - false - - - true - ${configurable_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 3 - = - true - product[weight] - false - - - true - ${configurable_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - false - - - true - <p>Configurable product description ${configurable_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - ${configurable_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${configurable_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${configurable_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - ${configurable_attribute_id} - = - true - product[configurable_variation] - false - - - true - ${configurable_product_name} - = - true - product[url_key] - - - true - 1 - = - true - product[use_config_gift_message_available] - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - - - true - 4 - = - true - product[visibility] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 50 - = - true - product[stock_data][qty] - false - - - true - configurable - = - true - product[stock_data][type_id] - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/id/${configurable_product_id}/ - POST - true - false - true - false - false - - - - - false - - - try { - int attributesCount = Integer.parseInt(vars.get("configurable_attribute_ids_matchNr")); - for (int i = 1; i <= attributesCount; i++) { - attributeId = vars.get("configurable_attribute_ids_" + i.toString()); - attributeCode = vars.get("configurable_attribute_codes_" + i.toString()); - attributeLabel = vars.get("configurable_attribute_labels_" + i.toString()); - ctx.getCurrentSampler().addArgument("attributes[" + (i - 1).toString() + "]", attributeId); - ctx.getCurrentSampler().addArgument("attribute_codes[" + (i - 1).toString() + "]", attributeCode); - ctx.getCurrentSampler().addArgument("product[" + attributeCode + "]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][position]", (i - 1).toString()); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attributeCode); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attributeLabel); - - int valuesCount = Integer.parseInt(vars.get("attribute_" + attributeId + "_values_matchNr")); - for (int j = 1; j <= valuesCount; j++) { - attributeValue = vars.get("attribute_" + attributeId + "_values_" + j.toString()); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][include]", - "1" - ); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][value_index]", - attributeValue - ); - } - } - ctx.getCurrentSampler().addArgument("associated_product_ids_serialized", vars.get("associated_products_ids").toString()); - } catch (Exception e) { - log.error("error???", e); - } - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${configurable_product_name} - = - true - product[name] - false - - - true - ${configurable_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id]admin - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 3 - = - true - product[weight] - false - - - true - ${configurable_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - false - - - true - <p>Configurable product description ${configurable_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - ${configurable_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${configurable_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${configurable_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - ${configurable_attribute_id} - = - true - product[configurable_variation] - false - - - true - ${configurable_product_name} - = - true - product[url_key] - - - true - 1 - = - true - product[use_config_gift_message_available] - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - - - true - 4 - = - true - product[visibility] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 50 - = - true - product[stock_data][qty] - false - - - true - configurable - = - true - product[stock_data][type_id] - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/id/${configurable_product_id}/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - false - - - try { - int attributesCount = Integer.parseInt(vars.get("configurable_attribute_ids_matchNr")); - for (int i = 1; i <= attributesCount; i++) { - attributeId = vars.get("configurable_attribute_ids_" + i.toString()); - attributeCode = vars.get("configurable_attribute_codes_" + i.toString()); - attributeLabel = vars.get("configurable_attribute_labels_" + i.toString()); - ctx.getCurrentSampler().addArgument("attributes[" + (i - 1).toString() + "]", attributeId); - ctx.getCurrentSampler().addArgument("attribute_codes[" + (i - 1).toString() + "]", attributeCode); - ctx.getCurrentSampler().addArgument("product[" + attributeCode + "]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][position]", (i - 1).toString()); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attributeCode); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attributeLabel); - - int valuesCount = Integer.parseInt(vars.get("attribute_" + attributeId + "_values_matchNr")); - for (int j = 1; j <= valuesCount; j++) { - attributeValue = vars.get("attribute_" + attributeId + "_values_" + j.toString()); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][include]", - "1" - ); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][value_index]", - attributeValue - ); - } - } - ctx.getCurrentSampler().addArgument("associated_product_ids_serialized", vars.get("associated_products_ids").toString()); - } catch (Exception e) { - log.error("error???", e); - } - - - - - You saved the product - - Assertion.response_data - false - 2 - if have trouble see messages-message-error - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminReturnsManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Returns Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/orders_page.jmx - - - - Create New Order - - Assertion.response_data - false - 2 - - - - - - - - - true - sales_order_grid - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 200 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - increment_id - = - true - sorting[field] - - - true - desc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - false - - - true - pending - = - true - filters[status] - true - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - sales_order_grid - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - 200 - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - increment_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - true - pending - = - true - filters[status] - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/search_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - false - order_numbers - \"increment_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - false - order_ids - \"entity_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - - - tool/fragments/ce/admin_create_process_returns/setup.jmx - - import java.util.ArrayList; - import java.util.HashMap; - import org.apache.jmeter.protocol.http.util.Base64Encoder; - import java.util.Random; - - // get count of "order_numbers" variable defined in "Search Pending Orders Limit" - int ordersCount = Integer.parseInt(vars.get("order_numbers_matchNr")); - - - int clusterLength; - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - //Number of orders for one thread - clusterLength = ordersCount; - } else { - clusterLength = Math.round(ordersCount / threadsNumber); - if (clusterLength == 0) { - clusterLength = 1; - } - } - - //Current thread number starts from 0 - int currentThreadNum = ctx.getThreadNum(); - - //Index of the current product from the cluster - Random random = new Random(); - if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - int iterator = random.nextInt(clusterLength); - if (iterator == 0) { - iterator = 1; - } - - int i = clusterLength * currentThreadNum + iterator; - - orderNumber = vars.get("order_numbers_" + i.toString()); - orderId = vars.get("order_ids_" + i.toString()); - vars.put("order_number", orderNumber); - vars.put("order_id", orderId); - - - - - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/view/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_order.jmx - - - - #${order_number} - - Assertion.response_data - false - 2 - - - - false - order_status - <span id="order_status">([^<]+)</span> - $1$ - - 1 - simple_products - - - - - - "${order_status}" == "Pending" - false - tool/fragments/ce/admin_edit_order/if_controller.jmx - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_start.jmx - - - - Invoice Totals - - Assertion.response_data - false - 2 - - - - false - item_ids - <div id="order_item_(\d+)_title"\s*class="product-title"> - $1$ - - -1 - simple_products - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - invoice[items][${item_ids_1}] - - - true - 1 - = - true - invoice[items][${item_ids_2}] - - - true - Invoiced - = - true - invoice[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx - - - - The invoice has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_creditmemo/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx - - - - New Memo - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - creditmemo[items][${item_ids_1}][qty] - - - true - 1 - = - true - creditmemo[items][${item_ids_2}][qty] - - - true - 1 - = - true - creditmemo[do_offline] - - - true - Credit Memo added - = - true - creditmemo[comment_text] - - - true - 10 - = - true - creditmemo[shipping_amount] - - - true - 0 - = - true - creditmemo[adjustment_positive] - - - true - 0 - = - true - creditmemo[adjustment_negative] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_creditmemo/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx - - - - You created the credit memo - - Assertion.response_data - false - 2 - - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))} - tool/fragments/ce/admin_create_process_returns/pause.jmx - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminBrowseCustomerGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Browse Customer Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Customer"); - - pagesCount = parseInt(vars.get("customers_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "customer_listing"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_customer_filter_text")); - vars.put("grid_filter_field", "name"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "name"); - vars.put("grid_sort_field_2", "group_id"); - vars.put("grid_sort_field_3", "billing_country_id"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_customers_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminCreateOrderPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Create Order"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.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(); - -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); -simpleList = props.get("simple_products_list").get(number1); -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")); - - -customers_index = 0; -if (!props.containsKey("customer_ids_index")) { - props.put("customer_ids_index", customers_index); -} - -try { - customers_index = props.get("customer_ids_index"); - customers_list = props.get("customer_ids_list"); - - if (customers_index == customers_list.size()) { - customers_index=0; - } - vars.put("customer_id", customers_list.get(customers_index)); - props.put("customer_ids_index", ++customers_index); -} -catch (java.lang.Exception e) { - log.error("Caught Exception in 'Admin Create Order' thread."); - SampleResult.setStopThread(true); -} - - - true - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/start/ - GET - true - false - true - false - false - - Detected the start of a redirect chain - - - - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${configurable_product_1_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - true - item[${simple_product_1_id}][qty] - 1 - = - true - - - true - item[${simple_product_2_id}][qty] - 1 - = - true - - - true - item[${configurable_product_1_id}][qty] - 1 - = - true - - - true - customer_id - ${customer_id} - = - true - - - true - store_id - 1 - = - true - - - true - currency_id - - = - true - - - true - form_key - ${admin_form_key} - = - true - - - true - payment[method] - checkmo - = - true - - - true - reset_shipping - 1 - = - true - - - true - json - 1 - = - true - - - true - as_js_varname - iFrameResponse - = - true - - - true - form_key - ${admin_form_key} - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/loadBlock/block/search,items,shipping_method,totals,giftmessage,billing_method?isAjax=true - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - false - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - - ctx.getCurrentSampler().addArgument("item[" + vars.get("configurable_product_1_id") + "][super_attribute][" + attribute_ids_array[i] + "]", option_values_array[i]); - } -} catch (Exception e) { - log.error("error???", e); -} - - - - - - - - true - collect_shipping_rates - 1 - = - true - - - true - customer_id - ${customer_id} - = - true - - - true - store_id - 1 - = - true - - - true - currency_id - false - = - true - - - true - form_key - ${admin_form_key} - = - true - - - true - payment[method] - checkmo - = - true - - - true - json - true - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/loadBlock/block/shipping_method,totals?isAjax=true - POST - true - false - true - false - false - - - - - - shipping_method - Flat Rate - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/index/ - GET - true - false - true - false - false - - Detected the start of a redirect chain - - - - - Select from existing customer addresses - Submit Order - Items Ordered - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - limit - 20 - = - true - - - true - entity_id - - = - true - - - true - name - - = - true - - - true - email - - = - true - - - true - Telephone - - = - true - - - true - billing_postcode - - = - true - - - true - billing_country_id - - = - true - - - true - billing_regione - - = - true - - - true - store_name - - = - true - - - true - page - 1 - = - true - - - true - order[currency] - USD - = - true - - - true - sku - - = - true - - - true - qty - - = - true - - - true - limit - 20 - = - true - - - true - entity_id - - = - true - - - true - name - - = - true - - - true - sku - - = - true - - - true - price[from] - - = - true - - - true - price[to] - - = - true - - - true - in_products - - = - true - - - true - page - 1 - = - true - - - true - coupon_code - - = - true - - - true - order[account][group_id] - 1 - = - true - - - true - order[account][email] - user_${customer_id}@example.com - = - true - - - true - order[billing_address][customer_address_id] - - = - true - - - true - order[billing_address][prefix] - - = - true - - - true - order[billing_address][firstname] - Anthony - = - true - - - true - order[billing_address][middlename] - - = - true - - - true - order[billing_address][lastname] - Nealy - = - true - - - true - order[billing_address][suffix] - - = - true - - - true - order[billing_address][company] - - = - true - - - true - order[billing_address][street][0] - 123 Freedom Blvd. #123 - = - true - - - true - order[billing_address][street][1] - - = - true - - - true - order[billing_address][city] - Fayetteville - = - true - - - true - order[billing_address][country_id] - US - = - true - - - true - order[billing_address][region] - - = - true - - - true - order[billing_address][region_id] - ${alabama_region_id} - = - true - - - true - order[billing_address][postcode] - 123123 - = - true - - - true - order[billing_address][telephone] - 022-333-4455 - = - true - - - true - order[billing_address][fax] - - = - true - - - true - order[billing_address][vat_id] - - = - true - - - true - shipping_same_as_billing - on - = - true - - - true - payment[method] - checkmo - = - true - - - true - order[shipping_method] - flatrate_flatrate - = - true - - - true - order[comment][customer_note] - - = - true - - - true - order[comment][customer_note_notify] - 1 - = - true - - - true - order[send_confirmation] - 1 - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/save/ - POST - true - false - true - true - false - - Detected the start of a redirect chain - - - - false - order_id - ${host}${base_path}${admin_path}/sales/order/index/order_id/(\d+)/ - $1$ - - 1 - - - - false - order_item_1 - order_item_(\d+)_title - $1$ - - 1 - - - - false - order_item_2 - order_item_(\d+)_title - $1$ - - 2 - - - - false - order_item_3 - order_item_(\d+)_title - $1$ - - 3 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_2 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_3 - - - - - You created the order. - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - invoice[items][${order_item_1}] - 1 - = - true - - - true - invoice[items][${order_item_2}] - 1 - = - true - - - true - invoice[items][${order_item_3}] - 1 - = - true - - - true - invoice[comment_text] - - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - - The invoice has been created. - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - shipment[items][${order_item_1}] - 1 - = - true - - - true - shipment[items][${order_item_2}] - 1 - = - true - - - true - shipment[items][${order_item_3}] - 1 - = - true - - - true - shipment[comment_text] - - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/ - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - - The shipment has been created. - - Assertion.response_data - false - 2 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminCategoryManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Category Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_category_management/admin_category_management.jmx - - - - javascript - - - - random = new java.util.Random(); -if (${seedForRandom} > 0) { -random.setSeed(${seedForRandom} + ${__threadNum}); -} - -/** - * Get unique ids for fix concurrent category saving - */ -function getNextProductNumber(i) { - number = productsVariationsSize * ${__threadNum} - i; - if (number >= productsSize) { - log.info("${testLabel}: capacity of product list is not enough for support all ${adminPoolUsers} threads"); - return random.nextInt(productsSize); - } - return productsVariationsSize * ${__threadNum} - i; -} - -var productsVariationsSize = 5, - productsSize = props.get("simple_products_list_for_edit").size(); - - -for (i = 1; i<= productsVariationsSize; i++) { - var productVariablePrefix = "simple_product_" + i + "_"; - number = getNextProductNumber(i); - simpleList = props.get("simple_products_list_for_edit").get(number); - - vars.put(productVariablePrefix + "url_key", simpleList.get("url_key")); - vars.put(productVariablePrefix + "id", simpleList.get("id")); - vars.put(productVariablePrefix + "name", simpleList.get("title")); -} - -categoryIndex = random.nextInt(props.get("admin_category_ids_list").size()); -vars.put("parent_category_id", props.get("admin_category_ids_list").get(categoryIndex)); -do { -categoryIndexNew = random.nextInt(props.get("admin_category_ids_list").size()); -} while(categoryIndex == categoryIndexNew); -vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(categoryIndexNew)); - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/edit/id/${parent_category_id}/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/add/store/0/parent/${parent_category_id} - GET - true - false - true - false - false - - - - - - <title>New Category - - Assertion.response_data - false - 2 - - - - - - - - true - - = - true - id - - - true - ${parent_category_id} - = - true - parent - - - true - - = - true - path - - - true - - = - true - store_id - - - true - 0 - = - true - is_active - - - true - 0 - = - true - include_in_menu - - - true - 1 - = - true - is_anchor - - - true - true - = - true - use_config[available_sort_by] - - - true - true - = - true - use_config[default_sort_by] - - - true - true - = - true - use_config[filter_price_range] - - - true - false - = - true - use_default[url_key] - - - true - 0 - = - true - url_key_create_redirect - - - true - 0 - = - true - custom_use_parent_settings - - - true - 0 - = - true - custom_apply_to_products - - - true - Admin Category Management ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - name - - - true - admin-category-management-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - url_key - - - true - - = - true - meta_title - - - true - - = - true - description - - - true - PRODUCTS - = - true - display_mode - - - true - position - = - true - default_sort_by - - - true - - = - true - meta_keywords - - - true - - = - true - meta_description - - - true - - = - true - custom_layout_update - - - false - {"${simple_product_1_id}":"","${simple_product_2_id}":"","${simple_product_3_id}":"","${simple_product_4_id}":"","${simple_product_5_id}":""} - = - true - category_products - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/save/ - POST - true - false - true - false - false - - - - - URL - admin_category_id - /catalog/category/edit/id/(\d+)/ - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_id - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/edit/id/${admin_category_id}/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - false - admin_category_entity_id - "entity_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_attribute_set_id - "attribute_set_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_parent_id - "parent_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_created_at - "created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_updated_at - "updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_path - "entity_id":(.+)"path":"([^\"]+)" - $2$ - - 1 - - - - false - admin_category_level - "level":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_name - "entity_id":(.+)"name":"([^"]+)" - $2$ - - 1 - - - - false - admin_category_url_key - "url_key":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_url_path - "url_path":"([^"]+)" - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_entity_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_attribute_set_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_parent_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_updated_at - - - - - ^[\d\\\/]+$ - - Assertion.response_data - false - 1 - variable - admin_category_path - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_level - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_name - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_url_key - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_url_path - - - - - ${simple_product_1_name} - ${simple_product_2_name} - ${simple_product_3_name} - ${simple_product_4_name} - ${simple_product_5_name} - - Assertion.response_data - false - 2 - - - - - - - - true - ${admin_category_id} - = - true - id - - - true - ${admin_form_key} - = - true - form_key - - - true - append - = - true - point - - - true - ${new_parent_category_id} - = - true - pid - - - true - ${parent_category_id} - = - true - paid - - - true - 0 - = - true - aid - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/move/ - POST - true - false - true - false - false - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/delete/id/${admin_category_id}/ - POST - true - false - true - false - false - - - - - - You deleted the category. - - Assertion.response_data - false - 2 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCategoryManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminPromotionRulesPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Promotion Rules"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/ - GET - true - false - true - false - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/new - GET - true - false - true - false - false - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - true - - - true - 1--1 - = - true - id - - - true - Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal - = - true - type - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/newConditionHtml/form/sales_rule_formrule_conditions_fieldset_/form_namespace/sales_rule_form - POST - true - false - true - false - false - - - - - - - - true - Rule Name ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - name - - - true - 0 - = - true - is_active - - - true - 0 - = - true - use_auto_generation - - - true - 1 - = - true - is_rss - - - true - 0 - = - true - apply_to_shipping - - - true - 0 - = - true - stop_rules_processing - - - true - - = - true - coupon_code - - - true - - = - true - uses_per_coupon - - - true - - = - true - uses_per_customer - - - true - - = - true - sort_order - - - true - 5 - = - true - discount_amount - - - true - 0 - = - true - discount_qty - - - true - - = - true - discount_step - - - true - - = - true - reward_points_delta - - - true - - = - true - store_labels[0] - - - true - Rule Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - description - - - true - 1 - = - true - coupon_type - - - true - cart_fixed - = - true - simple_action - - - true - 1 - = - true - website_ids[0] - - - true - 0 - = - true - customer_group_ids[0] - - - true - - = - true - from_date - - - true - - = - true - to_date - - - true - Magento\SalesRule\Model\Rule\Condition\Combine - = - true - rule[conditions][1][type] - - - true - all - = - true - rule[conditions][1][aggregator] - - - true - 1 - = - true - rule[conditions][1][value] - - - true - Magento\SalesRule\Model\Rule\Condition\Address - = - true - rule[conditions][1--1][type] - - - true - base_subtotal - = - true - rule[conditions][1--1][attribute] - - - true - >= - = - true - rule[conditions][1--1][operator] - - - true - 100 - = - true - rule[conditions][1--1][value] - - - true - - = - true - rule[conditions][1][new_chlid] - - - true - Magento\SalesRule\Model\Rule\Condition\Product\Combine - = - true - rule[actions][1][type] - - - true - all - = - true - rule[actions][1][aggregator] - - - true - 1 - = - true - rule[actions][1][value] - - - true - - = - true - rule[actions][1][new_child] - - - true - - = - true - store_labels[1] - - - true - - = - true - store_labels[2] - - - true - - = - true - related_banners - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/save/ - POST - true - false - true - false - false - - - - - - You saved the rule. - - Assertion.response_data - false - 16 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminPromotionsManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminCustomerManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Customer Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_customer_management/admin_customer_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - true - customer_listing - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 20 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - - - true - customer_listing - = - true - namespace - - - true - Lastname - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 20 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - false - customer_edit_url_path - actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/", - /customer/index/edit/id/$2$/ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - customer_edit_url_path - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}${customer_edit_url_path} - GET - true - false - true - false - false - - - - - - Customer Information - - Assertion.response_data - false - 2 - - - - false - admin_customer_entity_id - "entity_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_website_id - "website_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_firstname - "firstname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_lastname - "lastname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_email - "email":"([^\@]+@[^.]+.[^"]+)" - $1$ - - 1 - - - - false - admin_customer_group_id - "group_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_store_id - "store_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_created_at - "created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_updated_at - "updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_is_active - "is_active":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_disable_auto_group_change - "disable_auto_group_change":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_created_in - "created_in":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_dob - "dob":"(\d+)-(\d+)-(\d+)" - $2$/$3$/$1$ - - 1 - - - - false - admin_customer_default_billing - "default_billing":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_default_shipping - "default_shipping":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_gender - "gender":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_failures_num - "failures_num":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_address_entity_id - _address":\{"entity_id":"(\d+)".+?"parent_id":"${admin_customer_entity_id}" - $1$ - - 1 - - - - false - admin_customer_address_created_at - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_updated_at - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_is_active - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"is_active":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_address_city - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"city":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_country_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"country_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_firstname - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"firstname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_lastname - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"lastname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_postcode - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"postcode":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_region - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_region_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_street - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"street":\["([^"]+)"\] - $1$ - - 1 - - - - false - admin_customer_address_telephone - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"telephone":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_customer_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"customer_id":"([^"]+)" - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_entity_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_website_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_firstname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_lastname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_email - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_group_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_store_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_updated_at - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_is_active - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_disable_auto_group_change - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_created_in - - - - - ^\d+/\d+/\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_dob - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_default_billing - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_default_shipping - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_gender - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_failures_num - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_entity_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_updated_at - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_is_active - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_city - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_country_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_firstname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_lastname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_postcode - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_region - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_region_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_street - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_telephone - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_customer_id - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_customer_entity_id} - = - true - customer[entity_id] - - - true - ${admin_customer_website_id} - = - true - customer[website_id] - - - true - ${admin_customer_email} - = - true - customer[email] - - - true - ${admin_customer_group_id} - = - true - customer[group_id] - - - true - ${admin_customer_store_id} - = - true - customer[store_id] - - - true - ${admin_customer_created_at} - = - true - customer[created_at] - - - true - ${admin_customer_updated_at} - = - true - customer[updated_at] - - - true - ${admin_customer_is_active} - = - true - customer[is_active] - - - true - ${admin_customer_disable_auto_group_change} - = - true - customer[disable_auto_group_change] - - - true - ${admin_customer_created_in} - = - true - customer[created_in] - - - true - - = - true - customer[prefix] - - - true - ${admin_customer_firstname} 1 - = - true - customer[firstname] - - - true - - = - true - customer[middlename] - - - true - ${admin_customer_lastname} 1 - = - true - customer[lastname] - - - true - - = - true - customer[suffix] - - - true - ${admin_customer_dob} - = - true - customer[dob] - - - true - ${admin_customer_default_billing} - = - true - customer[default_billing] - - - true - ${admin_customer_default_shipping} - = - true - customer[default_shipping] - - - true - - = - true - customer[taxvat] - - - true - ${admin_customer_gender} - = - true - customer[gender] - - - true - ${admin_customer_failures_num} - = - true - customer[failures_num] - - - true - ${admin_customer_store_id} - = - true - customer[sendemail_store_id] - - - true - ${admin_customer_address_entity_id} - = - true - address[${admin_customer_address_entity_id}][entity_id] - - - true - ${admin_customer_address_created_at} - = - true - address[${admin_customer_address_entity_id}][created_at] - - - true - ${admin_customer_address_updated_at} - = - true - address[${admin_customer_address_entity_id}][updated_at] - - - true - ${admin_customer_address_is_active} - = - true - address[${admin_customer_address_entity_id}][is_active] - - - true - ${admin_customer_address_city} - = - true - address[${admin_customer_address_entity_id}][city] - - - true - - = - true - address[${admin_customer_address_entity_id}][company] - - - true - ${admin_customer_address_country_id} - = - true - address[${admin_customer_address_entity_id}][country_id] - - - true - ${admin_customer_address_firstname} - = - true - address[${admin_customer_address_entity_id}][firstname] - - - true - ${admin_customer_address_lastname} - = - true - address[${admin_customer_address_entity_id}][lastname] - - - true - - = - true - address[${admin_customer_address_entity_id}][middlename] - - - true - ${admin_customer_address_postcode} - = - true - address[${admin_customer_address_entity_id}][postcode] - - - true - - = - true - address[${admin_customer_address_entity_id}][prefix] - - - true - ${admin_customer_address_region} - = - true - address[${admin_customer_address_entity_id}][region] - - - true - ${admin_customer_address_region_id} - = - true - address[${admin_customer_address_entity_id}][region_id] - - - true - ${admin_customer_address_street} - = - true - address[${admin_customer_address_entity_id}][street][0] - - - true - - = - true - address[${admin_customer_address_entity_id}][street][1] - - - true - - = - true - address[${admin_customer_address_entity_id}][suffix] - - - true - ${admin_customer_address_telephone} - = - true - address[${admin_customer_address_entity_id}][telephone] - - - true - - = - true - address[${admin_customer_address_entity_id}][vat_id] - - - true - ${admin_customer_address_customer_id} - = - true - address[${admin_customer_address_entity_id}][customer_id] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_billing] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_shipping] - - - true - - = - true - address[new_0][prefix] - - - true - John - = - true - address[new_0][firstname] - - - true - - = - true - address[new_0][middlename] - - - true - Doe - = - true - address[new_0][lastname] - - - true - - = - true - address[new_0][suffix] - - - true - Test Company - = - true - address[new_0][company] - - - true - Folsom - = - true - address[new_0][city] - - - true - 95630 - = - true - address[new_0][postcode] - - - true - 1234567890 - = - true - address[new_0][telephone] - - - true - - = - true - address[new_0][vat_id] - - - true - false - = - true - address[new_0][default_billing] - - - true - false - = - true - address[new_0][default_shipping] - - - true - 123 Main - = - true - address[new_0][street][0] - - - true - - = - true - address[new_0][street][1] - - - true - - = - true - address[new_0][region] - - - true - US - = - true - address[new_0][country_id] - - - true - ${admin_customer_address_region_id} - = - true - address[new_0][region_id] - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index/validate/ - POST - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 16 - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_customer_entity_id} - = - true - customer[entity_id] - - - true - ${admin_customer_website_id} - = - true - customer[website_id] - - - true - ${admin_customer_email} - = - true - customer[email] - - - true - ${admin_customer_group_id} - = - true - customer[group_id] - - - true - ${admin_customer_store_id} - = - true - customer[store_id] - - - true - ${admin_customer_created_at} - = - true - customer[created_at] - - - true - ${admin_customer_updated_at} - = - true - customer[updated_at] - - - true - ${admin_customer_is_active} - = - true - customer[is_active] - - - true - ${admin_customer_disable_auto_group_change} - = - true - customer[disable_auto_group_change] - - - true - ${admin_customer_created_in} - = - true - customer[created_in] - - - true - - = - true - customer[prefix] - - - true - ${admin_customer_firstname} 1 - = - true - customer[firstname] - - - true - - = - true - customer[middlename] - - - true - ${admin_customer_lastname} 1 - = - true - customer[lastname] - - - true - - = - true - customer[suffix] - - - true - ${admin_customer_dob} - = - true - customer[dob] - - - true - ${admin_customer_default_billing} - = - true - customer[default_billing] - - - true - ${admin_customer_default_shipping} - = - true - customer[default_shipping] - - - true - - = - true - customer[taxvat] - - - true - ${admin_customer_gender} - = - true - customer[gender] - - - true - ${admin_customer_failures_num} - = - true - customer[failures_num] - - - true - ${admin_customer_store_id} - = - true - customer[sendemail_store_id] - - - true - ${admin_customer_address_entity_id} - = - true - address[${admin_customer_address_entity_id}][entity_id] - - - - true - ${admin_customer_address_created_at} - = - true - address[${admin_customer_address_entity_id}][created_at] - - - true - ${admin_customer_address_updated_at} - = - true - address[${admin_customer_address_entity_id}][updated_at] - - - true - ${admin_customer_address_is_active} - = - true - address[${admin_customer_address_entity_id}][is_active] - - - true - ${admin_customer_address_city} - = - true - address[${admin_customer_address_entity_id}][city] - - - true - - = - true - address[${admin_customer_address_entity_id}][company] - - - true - ${admin_customer_address_country_id} - = - true - address[${admin_customer_address_entity_id}][country_id] - - - true - ${admin_customer_address_firstname} - = - true - address[${admin_customer_address_entity_id}][firstname] - - - true - ${admin_customer_address_lastname} - = - true - address[${admin_customer_address_entity_id}][lastname] - - - true - - = - true - address[${admin_customer_address_entity_id}][middlename] - - - true - ${admin_customer_address_postcode} - = - true - address[${admin_customer_address_entity_id}][postcode] - - - true - - = - true - address[${admin_customer_address_entity_id}][prefix] - - - true - ${admin_customer_address_region} - = - true - address[${admin_customer_address_entity_id}][region] - - - true - ${admin_customer_address_region_id} - = - true - address[${admin_customer_address_entity_id}][region_id] - - - true - ${admin_customer_address_street} - = - true - address[${admin_customer_address_entity_id}][street][0] - - - true - - = - true - address[${admin_customer_address_entity_id}][street][1] - - - true - - = - true - address[${admin_customer_address_entity_id}][suffix] - - - true - ${admin_customer_address_telephone} - = - true - address[${admin_customer_address_entity_id}][telephone] - - - true - - = - true - address[${admin_customer_address_entity_id}][vat_id] - - - true - ${admin_customer_address_customer_id} - = - true - address[${admin_customer_address_entity_id}][customer_id] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_billing] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_shipping] - - - true - - = - true - address[new_0][prefix] - - - true - John - = - true - address[new_0][firstname] - - - true - - = - true - address[new_0][middlename] - - - true - Doe - = - true - address[new_0][lastname] - - - true - - = - true - address[new_0][suffix] - - - true - Test Company - = - true - address[new_0][company] - - - true - Folsom - = - true - address[new_0][city] - - - true - 95630 - = - true - address[new_0][postcode] - - - true - 1234567890 - = - true - address[new_0][telephone] - - - true - - = - true - address[new_0][vat_id] - - - true - false - = - true - address[new_0][default_billing] - - - true - false - = - true - address[new_0][default_shipping] - - - true - 123 Main - = - true - address[new_0][street][0] - - - true - - = - true - address[new_0][street][1] - - - true - - = - true - address[new_0][region] - - - true - US - = - true - address[new_0][country_id] - - - true - 12 - = - true - address[new_0][region_id] - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index/save/ - POST - true - false - true - true - false - - - - - - You saved the customer. - - Assertion.response_data - false - 2 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCustomerManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminEditOrderPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[C] Admin Edit Order"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/orders_page.jmx - - - - Create New Order - - Assertion.response_data - false - 2 - - - - - - - - - true - sales_order_grid - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 200 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - increment_id - = - true - sorting[field] - - - true - desc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - false - - - true - pending - = - true - filters[status] - true - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - sales_order_grid - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - 200 - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - increment_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - true - pending - = - true - filters[status] - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/search_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - false - order_numbers - \"increment_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - false - order_ids - \"entity_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - - - tool/fragments/ce/admin_create_process_returns/setup.jmx - - import java.util.ArrayList; - import java.util.HashMap; - import org.apache.jmeter.protocol.http.util.Base64Encoder; - import java.util.Random; - - // get count of "order_numbers" variable defined in "Search Pending Orders Limit" - int ordersCount = Integer.parseInt(vars.get("order_numbers_matchNr")); - - - int clusterLength; - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - //Number of orders for one thread - clusterLength = ordersCount; - } else { - clusterLength = Math.round(ordersCount / threadsNumber); - if (clusterLength == 0) { - clusterLength = 1; - } - } - - //Current thread number starts from 0 - int currentThreadNum = ctx.getThreadNum(); - - //Index of the current product from the cluster - Random random = new Random(); - if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - int iterator = random.nextInt(clusterLength); - if (iterator == 0) { - iterator = 1; - } - - int i = clusterLength * currentThreadNum + iterator; - - orderNumber = vars.get("order_numbers_" + i.toString()); - orderId = vars.get("order_ids_" + i.toString()); - vars.put("order_number", orderNumber); - vars.put("order_id", orderId); - - - - - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/view/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_order.jmx - - - - #${order_number} - - Assertion.response_data - false - 2 - - - - false - order_status - <span id="order_status">([^<]+)</span> - $1$ - - 1 - simple_products - - - - - - "${order_status}" == "Pending" - false - tool/fragments/ce/admin_edit_order/if_controller.jmx - - - - - - true - pending - = - true - history[status] - false - - - true - Some text - = - true - history[comment] - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/addComment/order_id/${order_id}/?isAjax=true - POST - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/add_comment.jmx - - - - Not Notified - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_start.jmx - - - - Invoice Totals - - Assertion.response_data - false - 2 - - - - false - item_ids - <div id="order_item_(\d+)_title"\s*class="product-title"> - $1$ - - -1 - simple_products - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - invoice[items][${item_ids_1}] - - - true - 1 - = - true - invoice[items][${item_ids_2}] - - - true - Invoiced - = - true - invoice[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx - - - - The invoice has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/shipment_start.jmx - - - - New Shipment - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - shipment[items][${item_ids_1}] - - - true - 1 - = - true - shipment[items][${item_ids_2}] - - - true - Shipped - = - true - shipment[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/shipment_submit.jmx - - - - The shipment has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - - - continue - - false - ${loops} - - ${graphQLcombinedBenchmarkPoolUsers} - ${ramp_period} - 1505803944000 - 1505803944000 - false - - - tool/fragments/_system/thread_group.jmx - - - javascript - - - - var cacheHitPercent = vars.get("cache_hits_percentage"); - -if ( - cacheHitPercent < 100 && - sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - doCache(); -} - -function doCache(){ - var random = Math.random() * 100; - if (cacheHitPercent < random) { - sampler.setPath(sampler.getPath() + "?cacheModifier=" + Math.random().toString(36).substring(2, 13)); - } -} - - tool/fragments/ce/common/cache_hit_miss.jmx - - - - 1 - false - 1 - ${cBrowseCatalogByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Catalog Browsing By Guest"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - - {"query":"query getCmsPage($identifier: String!, $onServer: Boolean!) {\n cmsPage(identifier: $identifier) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"identifier":"home","onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_home_page.jmx - - - - $.data.cmsPage.url_key - - false - false - false - false - - - - - - true - - - - false - - {"query" : "{\n categoryList(filters:{}) {\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_categories.jmx - - - - $.data.categoryList - - false - false - false - false - - - - - - true - - - - false - {"query":"query category($id: Int!, $currentPage: Int, $pageSize: Int) {\n category(id: $id) {\n product_count\n description\n url_key\n name\n id\n breadcrumbs {\n category_name\n category_url_key\n __typename\n }\n products(pageSize: $pageSize, currentPage: $currentPage, sort: {name: ASC}) {\n total_count\n items {\n id\n name\n # small_image\n # short_description\n url_key\n special_price\n special_from_date\n special_to_date\n price {\n regularPrice {\n amount {\n value\n currency\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n","variables":{"id":${category_id},"currentPage":1,"pageSize":12},"operationName":"category"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx - - - - - "name":"${category_name}","id":${category_id}, - - Assertion.response_data - false - 2 - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${cSiteSearchPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Site Search"); - - true - - - - - ${files_folder}search_terms.csv - UTF-8 - - , - false - true - false - shareMode.thread - tool/fragments/ce/search/search_terms.jmx - - - - javascript - - - - var cacheHitPercent = vars.get("cache_hits_percentage"); - -if ( - cacheHitPercent < 100 && - sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - doCache(); -} - -function doCache(){ - var random = Math.random() * 100; - if (cacheHitPercent < random) { - sampler.setPath(sampler.getPath() + "?cacheModifier=" + Math.random().toString(36).substring(2, 13)); - } -} - - tool/fragments/ce/common/cache_hit_miss.jmx - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - 1 - false - 1 - ${searchQuickPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Quick Search"); - - true - - - - - true - - - - false - - {"query":"query getCmsPage($identifier: String!, $onServer: Boolean!) {\n cmsPage(identifier: $identifier) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"identifier":"home","onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_home_page.jmx - - - - $.data.cmsPage.url_key - - false - false - false - false - - - - - - true - - - - false - {"query":"{\n products(\n pageSize:20\n search: \"${searchTerm}\"\n sort: {name: ASC}) { \n total_count \n items \n { \n name \n sku \n url_key \n } \n page_info{ \n current_page \n page_size \n total_pages \n } \n filters{ \n name \n request_var \n filter_items_count \n filter_items{ \n label \n items_count \n value_string \n __typename \n } \n } \n aggregations{ \n attribute_code \n count \n label \n options{ \n label \n value \n count \n } \n } \n } \n }\n","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/search_quick.jmx - - - - graphql_search_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - false - product_url_keys - "url_key":"([^'"]+) - $1$ - - -1 - - - - attribute_code_1 - $.data.products.filters[1].request_var - - - BODY - - - - attribute_value_1 - $.data.products.filters[1].filter_items[0].value_string - - - BODY - - - - attribute_code_2 - $.data.products.filters[2].request_var - - - BODY - - - - attribute_value_2 - $.data.products.filters[2].filter_items[0].value_string - - - BODY - - - - - - -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup.jmx - -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - - - - true - - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_product_details_by_product_url_key.jmx - - - - $.data.productDetail.items[0].sku - - false - false - false - false - - - - - - - - - 1 - false - 1 - ${searchQuickFilterPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Quick Search With Filtration"); - - true - - - - - true - - - - false - - {"query":"query getCmsPage($identifier: String!, $onServer: Boolean!) {\n cmsPage(identifier: $identifier) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"identifier":"home","onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_home_page.jmx - - - - $.data.cmsPage.url_key - - false - false - false - false - - - - - - true - - - - false - {"query":"{\n products(\n pageSize:20\n search: \"${searchTerm}\"\n sort: {name: ASC}) { \n total_count \n items \n { \n name \n sku \n url_key \n } \n page_info{ \n current_page \n page_size \n total_pages \n } \n filters{ \n name \n request_var \n filter_items_count \n filter_items{ \n label \n items_count \n value_string \n __typename \n } \n } \n aggregations{ \n attribute_code \n count \n label \n options{ \n label \n value \n count \n } \n } \n } \n }\n","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/search_quick.jmx - - - - graphql_search_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - false - product_url_keys - "url_key":"([^'"]+) - $1$ - - -1 - - - - attribute_code_1 - $.data.products.filters[1].request_var - - - BODY - - - - attribute_value_1 - $.data.products.filters[1].filter_items[0].value_string - - - BODY - - - - attribute_code_2 - $.data.products.filters[2].request_var - - - BODY - - - - attribute_value_2 - $.data.products.filters[2].filter_items[0].value_string - - - BODY - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/graphql/searched_attributes_setup.jmx - -number = vars.get("_counter"); -attribute_code = vars.get("attribute_code_"+number); - -vars.put("attribute_code", attribute_code); - -attribute_value = vars.get("attribute_value_"+number); - -vars.put("attribute_value", attribute_value); - - - - true - - - - - true - - - - false - {"query":"{\n products(\n pageSize:20\n search: \"${searchTerm}\"\n filter:{ \n ${attribute_code}: {in:[\"${attribute_value}\"]} \n } \n sort: {name: ASC}) { \n total_count \n items \n { \n name \n sku \n url_key \n } \n page_info{ \n current_page \n page_size \n total_pages \n } \n filters{ \n name \n request_var \n filter_items_count \n filter_items{ \n label \n items_count \n value_string \n __typename \n } \n } \n aggregations{ \n attribute_code \n count \n label \n options{ \n label \n value \n count \n } \n } \n } \n }\n","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/search_quick_filter_attribute.jmx - - - - graphql_search_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - false - product_url_keys - "url_key":"([^'"]+) - $1$ - - -1 - - - - - - - -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup.jmx - -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - - - - true - - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_product_details_by_product_url_key.jmx - - - - $.data.productDetail.items[0].sku - - false - false - false - false - - - - - - - - - 1 - false - 1 - ${searchAdvancedPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Advanced Search"); - - true - - - - - true - - - - false - - {"query":"query getCmsPage($identifier: String!, $onServer: Boolean!) {\n cmsPage(identifier: $identifier) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"identifier":"home","onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_home_page.jmx - - - - $.data.cmsPage.url_key - - false - false - false - false - - - - - - true - - - - false - {"query":"{\n products(\n pageSize:20\n filter:{ \n price: {to:\"${priceTo}\"} \n description:{match:\"${searchTerm}\"} \n } \n sort: {name: ASC}) { \n total_count \n items \n { \n name \n sku \n url_key \n } \n page_info{ \n current_page \n page_size \n total_pages \n } \n filters{ \n name \n request_var \n filter_items_count \n filter_items{ \n label \n items_count \n value_string \n __typename \n } \n } \n aggregations{ \n attribute_code \n count \n label \n options{ \n label \n value \n count \n } \n } \n } \n }\n","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/search_advanced.jmx - - - - graphql_search_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - false - product_url_keys - "url_key":"([^'"]+) - $1$ - - -1 - - - - - - -foundProducts = Integer.parseInt(vars.get("product_url_keys_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup.jmx - -number = vars.get("_counter"); -product = vars.get("product_url_keys_"+number); - -vars.put("product_url_key", product); - - - - true - - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_product_details_by_product_url_key.jmx - - - - $.data.productDetail.items[0].sku - - false - false - false - false - - - - - - - - - - - 1 - false - 1 - ${cAddToCartByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Add To Cart By Guest"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_empty_cart.jmx - - - - - {"data":{"cart":{"items":[]}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - - {"query":"query getCmsPage($identifier: String!, $onServer: Boolean!) {\n cmsPage(identifier: $identifier) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"identifier":"home","onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_home_page.jmx - - - - $.data.cmsPage.url_key - - false - false - false - false - - - - - - true - - - - false - - {"query" : "{\n categoryList(filters:{}) {\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_categories.jmx - - - - $.data.categoryList - - false - false - false - false - - - - - - true - - - - false - {"query":"query category($id: Int!, $currentPage: Int, $pageSize: Int) {\n category(id: $id) {\n product_count\n description\n url_key\n name\n id\n breadcrumbs {\n category_name\n category_url_key\n __typename\n }\n products(pageSize: $pageSize, currentPage: $currentPage, sort: {name: ASC}) {\n total_count\n items {\n id\n name\n # small_image\n # short_description\n url_key\n special_price\n special_from_date\n special_to_date\n price {\n regularPrice {\n amount {\n value\n currency\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n","variables":{"id":${category_id},"currentPage":1,"pageSize":12},"operationName":"category"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx - - - - - "name":"${category_name}","id":${category_id}, - - Assertion.response_data - false - 2 - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation { \n addSimpleProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n data: {\n quantity: 2\n sku: \"${product_sku}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n quantity\n product {\n sku\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_cart.jmx - - - - - addSimpleProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - product_option - $.data.productDetail.items[0].variants[0].product.sku - - - BODY - tool/fragments/ce/graphql/extract_configurable_product_option_from_product_detail.jmx - - - - - true - - - - false - {"query":"mutation {\n addConfigurableProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n variant_sku: \"${product_option}\"\n data: {\n quantity: 2\n sku: \"${product_option}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n id\n quantity\n product {\n name\n sku\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx - - - - - addConfigurableProductsToCart - "sku":"${product_option}" - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - ${cAddToWishlistPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Add to Wishlist"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - true - - - - false - {"query":"mutation {\n generateCustomerToken(\n email: \"${customer_email}\" \n password: \"${customer_password}\" \n ) {\n token \n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/login.jmx - - - - customer_token - $.data.generateCustomerToken.token - - - BODY - - - - $.data.generateCustomerToken.token - - false - false - false - false - - - - - - true - - - - false - {"query":" { \n customer {\n wishlist \n { \n id \n } \n } \n }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_wishlist.jmx - - - - wishlist_id - $.data.customer.wishlist.id - - - BODY - - - - $.data.customer.wishlist.id - - false - false - false - false - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - 5 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query": "mutation{ \n addProductsToWishlist( \n wishlistId: ${wishlist_id} \n wishlistItems:[ \n { \n sku: \"${product_sku}\" \n quantity: 1 \n } \n ]) \n { \n wishlist{ \n id \n items_count \n items{ \n id \n product{name sku} description qty} \n } \n user_errors{code message} \n } \n }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_wishlist.jmx - - - - wishlist_product_id - $.data.addProductsToWishlist.wishlist.items[0].id - - - BODY - - - - $.data.addProductsToWishlist.wishlist - - false - false - false - false - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - - true - 5 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - true - - - - false - {"query": "mutation { \n removeProductsFromWishlist( \n wishlistId: \"${wishlist_id}\", \n wishlistItemsIds: [\"${wishlist_product_id}\"] \n ) { \n user_errors { \n code \n message \n } \n wishlist { \n id \n sharing_code \n items_count \n items_v2 { \n items {id description quantity product {name sku}} \n } \n } \n } \n }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/clear_wishlist.jmx - - - - wishlist_product_id - $.data.removeProductsFromWishlist.wishlist.items_v2.items[0].id - - - BODY - - - - $.data.removeProductsFromWishlist.wishlist - - false - false - false - false - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - - true - - - - false - {"query":" { \n customer {\n wishlist \n { \n id \n items_count \n } \n } \n }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/check_wishlist.jmx - - - - $.data.customer.wishlist.items_count - 0 - true - false - false - false - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":"mutation {\n revokeCustomerToken {\n result \n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/logout.jmx - - - - $.data.revokeCustomerToken.result - true - true - false - false - false - - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - - - 1 - false - 1 - ${cCompareProductsPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Compare Products"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - {"query":"mutation {\n createCompareList \n { \n uid \n } \n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_compare_list.jmx - - - - compare_list_id - $.data.createCompareList.uid - - - BODY - - - - $.data.createCompareList.uid - - false - false - false - false - - - - - - true - - - - false - - {"query" : "{\n categoryList(filters:{}) {\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_categories.jmx - - - - $.data.categoryList - - false - false - false - false - - - - - - true - - - - false - {"query":"query category($id: Int!, $currentPage: Int, $pageSize: Int) {\n category(id: $id) {\n product_count\n description\n url_key\n name\n id\n breadcrumbs {\n category_name\n category_url_key\n __typename\n }\n products(pageSize: $pageSize, currentPage: $currentPage, sort: {name: ASC}) {\n total_count\n items {\n id\n name\n # small_image\n # short_description\n url_key\n special_price\n special_from_date\n special_to_date\n price {\n regularPrice {\n amount {\n value\n currency\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n","variables":{"id":${category_id},"currentPage":1,"pageSize":12},"operationName":"category"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx - - - - - "name":"${category_name}","id":${category_id}, - - Assertion.response_data - false - 2 - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation{ \n addProductsToCompareList(input: { uid: \"${compare_list_id}\", products: [${product_id}]}) { \n uid \n item_count \n attributes{code label} \n items { \n product { \n sku \n } \n } \n } \n }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/product_compare_add.jmx - - - - $.data.addProductsToCompareList.item_count - - false - false - false - false - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation{ \n addProductsToCompareList(input: { uid: \"${compare_list_id}\", products: [${product_id}]}) { \n uid \n item_count \n attributes{code label} \n items { \n product { \n sku \n } \n } \n } \n }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/product_compare_add.jmx - - - - $.data.addProductsToCompareList.item_count - - false - false - false - false - - - - - - - true - - - - false - {"query" :"{\n compareList(uid: \"${compare_list_id}\") { \n uid \n items { \n product { \n sku \n } \n } \n } \n}"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/compare_products.jmx - - - - $.data.compareList.items - - false - false - false - false - - - - - - true - - - - false - {"query":"mutation {\n deleteCompareList(uid: \"${compare_list_id}\") \n { \n result \n } \n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/compare_products_clear.jmx - - - - $.data.deleteCompareList.result - true - true - false - false - false - - - - - - - - 1 - false - 1 - ${cCheckoutByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Checkout By Guest"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_empty_cart.jmx - - - - - {"data":{"cart":{"items":[]}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - - {"query":"query getCmsPage($identifier: String!, $onServer: Boolean!) {\n cmsPage(identifier: $identifier) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"identifier":"home","onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_home_page.jmx - - - - $.data.cmsPage.url_key - - false - false - false - false - - - - - - true - - - - false - - {"query" : "{\n categoryList(filters:{}) {\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_categories.jmx - - - - $.data.categoryList - - false - false - false - false - - - - - - true - - - - false - {"query":"query category($id: Int!, $currentPage: Int, $pageSize: Int) {\n category(id: $id) {\n product_count\n description\n url_key\n name\n id\n breadcrumbs {\n category_name\n category_url_key\n __typename\n }\n products(pageSize: $pageSize, currentPage: $currentPage, sort: {name: ASC}) {\n total_count\n items {\n id\n name\n # small_image\n # short_description\n url_key\n special_price\n special_from_date\n special_to_date\n price {\n regularPrice {\n amount {\n value\n currency\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n","variables":{"id":${category_id},"currentPage":1,"pageSize":12},"operationName":"category"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx - - - - - "name":"${category_name}","id":${category_id}, - - Assertion.response_data - false - 2 - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation { \n addSimpleProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n data: {\n quantity: 2\n sku: \"${product_sku}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n quantity\n product {\n sku\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_cart.jmx - - - - - addSimpleProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - product_option - $.data.productDetail.items[0].variants[0].product.sku - - - BODY - tool/fragments/ce/graphql/extract_configurable_product_option_from_product_detail.jmx - - - - - true - - - - false - {"query":"mutation {\n addConfigurableProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n variant_sku: \"${product_option}\"\n data: {\n quantity: 2\n sku: \"${product_option}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n id\n quantity\n product {\n name\n sku\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx - - - - - addConfigurableProductsToCart - "sku":"${product_option}" - - Assertion.response_data - false - 2 - - - - - - - true - - - - false - {"query":"mutation {\n setGuestEmailOnCart(input: \n {\n cart_id: \"${quote_id}\" \n email: \"test@example.com\" \n }) {\n cart {\n email \n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/checkout_email_available.jmx - - - - $.data.setGuestEmailOnCart.cart.email - - false - false - false - false - - - - - - true - - - - false - {"query":"mutation {\n setBillingAddressOnCart(\n input: {\n cart_id: \"${quote_id}\"\n billing_address: {\n address: {\n firstname: \"test firstname\"\n lastname: \"test lastname\"\n company: \"test company\"\n street: [\"test street 1\", \"test street 2\"]\n city: \"test city\"\n region: \"AZ\"\n postcode: \"887766\"\n country_code: \"US\"\n telephone: \"88776655\"\n save_in_address_book: false\n }\n }\n }\n ) {\n cart {\n billing_address {\n firstname\n lastname\n company\n street\n city\n postcode\n telephone\n country {\n code\n label\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_billing_address_on_cart.jmx - - - - - {"data":{"setBillingAddressOnCart":{"cart":{"billing_address":{"firstname":"test firstname","lastname":"test lastname","company":"test company","street":["test street 1","test street 2"],"city":"test city","postcode":"887766","telephone":"88776655","country":{"code":"US","label":"US"}}}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"mutation {\n setShippingAddressesOnCart(\n input: {\n cart_id: \"${quote_id}\"\n shipping_addresses: [\n {\n address: {\n firstname: \"test firstname\"\n lastname: \"test lastname\"\n company: \"test company\"\n street: [\"test street 1\", \"test street 2\"]\n city: \"test city\"\n region: \"AZ\"\n postcode: \"887766\"\n country_code: \"US\"\n telephone: \"88776655\"\n save_in_address_book: false\n }\n }\n ]\n }\n ) {\n cart {\n shipping_addresses {\n firstname\n lastname\n company\n street\n city\n postcode\n telephone\n country {\n code\n label\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx - - - - - {"data":{"setShippingAddressesOnCart":{"cart":{"shipping_addresses":[{"firstname":"test firstname","lastname":"test lastname","company":"test company","street":["test street 1","test street 2"],"city":"test city","postcode":"887766","telephone":"88776655","country":{"code":"US","label":"US"}}]}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"mutation {\n setPaymentMethodOnCart(input: {\n cart_id: \"${quote_id}\", \n payment_method: {\n code: \"checkmo\"\n }\n }) {\n cart {\n selected_payment_method {\n code\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_payment_method_on_cart.jmx - - - - - {"data":{"setPaymentMethodOnCart":{"cart":{"selected_payment_method":{"code":"checkmo"}}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n shipping_addresses {\n postcode\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_current_shipping_address.jmx - - - - - true - - - - false - {"query":"mutation {\n setShippingMethodsOnCart(input: \n {\n cart_id: \"${quote_id}\", \n shipping_methods: [{\n carrier_code: \"flatrate\"\n method_code: \"flatrate\"\n }]\n }) {\n cart {\n shipping_addresses {\n selected_shipping_method {\n carrier_code\n method_code\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx - - - - - {"data":{"setShippingMethodsOnCart":{"cart":{"shipping_addresses":[{"selected_shipping_method":{"carrier_code":"flatrate","method_code":"flatrate"}}]}}}} - - Assertion.response_data - false - 8 - - - - - - true - - - - false - {"query":"mutation {\n placeOrder(input: \n {\n cart_id: \"${quote_id}\" \n }) {\n order {\n order_number \n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/place_order.jmx - - - - $.data.placeOrder.order.order_number - - false - false - false - false - - - - - - - - 1 - false - 1 - ${cCheckoutByCustomerPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Checkout By Customer"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - true - - - - false - {"query":"mutation {\n generateCustomerToken(\n email: \"${customer_email}\" \n password: \"${customer_password}\" \n ) {\n token \n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/login.jmx - - - - customer_token - $.data.generateCustomerToken.token - - - BODY - - - - $.data.generateCustomerToken.token - - false - false - false - false - - - - - - true - - - - false - {"query":"mutation {\n createEmptyCart\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/create_empty_cart.jmx - - - - quote_id - $.data.createEmptyCart - - - BODY - - - - - {"data":{"createEmptyCart":" - - Assertion.response_data - false - 2 - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n items {\n id\n quantity\n product {\n sku\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_empty_cart.jmx - - - - - {"data":{"cart":{"items":[]}}} - - Assertion.response_data - false - 8 - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - - {"query":"query getCmsPage($identifier: String!, $onServer: Boolean!) {\n cmsPage(identifier: $identifier) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"identifier":"home","onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_home_page.jmx - - - - $.data.cmsPage.url_key - - false - false - false - false - - - - - - true - - - - false - - {"query" : "{\n categoryList(filters:{}) {\n id\n children {\n id\n name\n url_key\n url_path\n children_count\n path\n image\n productImagePreview: products(pageSize: 1, sort: {name: ASC}) {\n items {\n small_image {\n label\n url\n }\n }\n }\n }\n }\n}"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_categories.jmx - - - - $.data.categoryList - - false - false - false - false - - - - - - true - - - - false - {"query":"query category($id: Int!, $currentPage: Int, $pageSize: Int) {\n category(id: $id) {\n product_count\n description\n url_key\n name\n id\n breadcrumbs {\n category_name\n category_url_key\n __typename\n }\n products(pageSize: $pageSize, currentPage: $currentPage, sort: {name: ASC}) {\n total_count\n items {\n id\n name\n # small_image\n # short_description\n url_key\n special_price\n special_from_date\n special_to_date\n price {\n regularPrice {\n amount {\n value\n currency\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n","variables":{"id":${category_id},"currentPage":1,"pageSize":12},"operationName":"category"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_list_of_products_by_category_id.jmx - - - - - "name":"${category_name}","id":${category_id}, - - Assertion.response_data - false - 2 - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_simple_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"query":"mutation { \n addSimpleProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n data: {\n quantity: 2\n sku: \"${product_sku}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n quantity\n product {\n sku\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_simple_product_to_cart.jmx - - - - - addSimpleProductsToCart - "sku":"${product_sku}" - - Assertion.response_data - false - 2 - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - true - - - - false - {"query":"query productDetail($urlKey: String, $onServer: Boolean!) {\n productDetail: products(filter: { url_key: { eq: $urlKey } }, sort: {name: ASC}) {\n items {\n sku\n name\n price {\n regularPrice {\n amount {\n currency\n value\n }\n }\n }\n description {html}\n media_gallery_entries {\n label\n position\n disabled\n file\n }\n ... on ConfigurableProduct {\n configurable_options {\n attribute_code\n attribute_id\n id\n label\n values {\n default_label\n label\n store_label\n use_default_value\n value_index\n }\n }\n variants {\n product {\n id\n media_gallery_entries {\n disabled\n file\n label\n position\n }\n sku\n stock_status\n }\n }\n }\n meta_title @include(if: $onServer)\n # Yes, Products have `meta_keyword` and\n # everything else has `meta_keywords`.\n meta_keyword @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n }\n}","variables":{"urlKey":"${product_url_key}","onServer":false},"operationName":"productDetail"} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_configurable_product_details_by_product_url_key.jmx - - - - - "sku":"${product_sku}","name":"${product_name}" - - Assertion.response_data - false - 2 - - - - - product_option - $.data.productDetail.items[0].variants[0].product.sku - - - BODY - tool/fragments/ce/graphql/extract_configurable_product_option_from_product_detail.jmx - - - - - true - - - - false - {"query":"mutation {\n addConfigurableProductsToCart(\n input: {\n cart_id: \"${quote_id}\"\n cart_items: [\n {\n variant_sku: \"${product_option}\"\n data: {\n quantity: 2\n sku: \"${product_option}\"\n }\n }\n ]\n }\n ) {\n cart {\n items {\n id\n quantity\n product {\n name\n sku\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/add_configurable_product_to_cart.jmx - - - - - addConfigurableProductsToCart - "sku":"${product_option}" - - Assertion.response_data - false - 2 - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - - true - - - - false - {"query":"mutation {\n setBillingAddressOnCart(\n input: {\n cart_id: \"${quote_id}\"\n billing_address: {\n address: {\n firstname: \"test firstname\"\n lastname: \"test lastname\"\n company: \"test company\"\n street: [\"test street 1\", \"test street 2\"]\n city: \"test city\"\n region: \"AZ\"\n postcode: \"887766\"\n country_code: \"US\"\n telephone: \"88776655\"\n save_in_address_book: false\n }\n }\n }\n ) {\n cart {\n billing_address {\n firstname\n lastname\n company\n street\n city\n postcode\n telephone\n country {\n code\n label\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_billing_address_on_cart.jmx - - - - - {"data":{"setBillingAddressOnCart":{"cart":{"billing_address":{"firstname":"test firstname","lastname":"test lastname","company":"test company","street":["test street 1","test street 2"],"city":"test city","postcode":"887766","telephone":"88776655","country":{"code":"US","label":"US"}}}}}} - - Assertion.response_data - false - 8 - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":"mutation {\n setShippingAddressesOnCart(\n input: {\n cart_id: \"${quote_id}\"\n shipping_addresses: [\n {\n address: {\n firstname: \"test firstname\"\n lastname: \"test lastname\"\n company: \"test company\"\n street: [\"test street 1\", \"test street 2\"]\n city: \"test city\"\n region: \"AZ\"\n postcode: \"887766\"\n country_code: \"US\"\n telephone: \"88776655\"\n save_in_address_book: false\n }\n }\n ]\n }\n ) {\n cart {\n shipping_addresses {\n firstname\n lastname\n company\n street\n city\n postcode\n telephone\n country {\n code\n label\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_shipping_address_on_cart.jmx - - - - - {"data":{"setShippingAddressesOnCart":{"cart":{"shipping_addresses":[{"firstname":"test firstname","lastname":"test lastname","company":"test company","street":["test street 1","test street 2"],"city":"test city","postcode":"887766","telephone":"88776655","country":{"code":"US","label":"US"}}]}}}} - - Assertion.response_data - false - 8 - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":"mutation {\n setPaymentMethodOnCart(input: {\n cart_id: \"${quote_id}\", \n payment_method: {\n code: \"checkmo\"\n }\n }) {\n cart {\n selected_payment_method {\n code\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_payment_method_on_cart.jmx - - - - - {"data":{"setPaymentMethodOnCart":{"cart":{"selected_payment_method":{"code":"checkmo"}}}}} - - Assertion.response_data - false - 8 - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":"{\n cart(cart_id: \"${quote_id}\") {\n shipping_addresses {\n postcode\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_current_shipping_address.jmx - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":"mutation {\n setShippingMethodsOnCart(input: \n {\n cart_id: \"${quote_id}\", \n shipping_methods: [{\n carrier_code: \"flatrate\"\n method_code: \"flatrate\"\n }]\n }) {\n cart {\n shipping_addresses {\n selected_shipping_method {\n carrier_code\n method_code\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/set_shipping_method_on_cart.jmx - - - - - {"data":{"setShippingMethodsOnCart":{"cart":{"shipping_addresses":[{"selected_shipping_method":{"carrier_code":"flatrate","method_code":"flatrate"}}]}}}} - - Assertion.response_data - false - 8 - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":"mutation {\n placeOrder(input: \n {\n cart_id: \"${quote_id}\" \n }) {\n order {\n order_number \n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/place_order.jmx - - - - $.data.placeOrder.order.order_number - - false - false - false - false - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":"mutation {\n revokeCustomerToken {\n result \n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/logout.jmx - - - - $.data.revokeCustomerToken.result - true - true - false - false - false - - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - - - 1 - false - 1 - ${cAccountManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Account management"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - true - - - - false - - {"query":"query getCmsPage($identifier: String!, $onServer: Boolean!) {\n cmsPage(identifier: $identifier) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"identifier":"home","onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_home_page.jmx - - - - $.data.cmsPage.url_key - - false - false - false - false - - - - - - true - - - - false - {"query":"mutation {\n generateCustomerToken(\n email: \"${customer_email}\" \n password: \"${customer_password}\" \n ) {\n token \n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/login.jmx - - - - customer_token - $.data.generateCustomerToken.token - - - BODY - - - - $.data.generateCustomerToken.token - - false - false - false - false - - - - - - true - - - - false - {"query":" { \n customer \n { orders \n {\n items {\n id \n number \n order_date \n status \n } \n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/my_orders.jmx - - - - order_number - $.data.customer.orders.items[0].number - NOT_FOUND - - BODY - - - - $.data.customer.orders - - false - false - false - false - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - tool/fragments/ce/graphql/if_orders.jmx - "${order_number}" != "NOT_FOUND" - false - - - - true - - - - false - {"query":" { \n customer \n { orders(filter: {number: {eq: \"${order_number}\"}}) \n {\n items {\n id \n number \n order_date \n status \n items { \n product_name \n product_sku \n product_url_key \n product_sale_price { \n value \n } \n product_sale_price { \n value \n currency \n } \n quantity_ordered \n quantity_invoiced \n quantity_shipped \n } \n carrier \n shipments { \n id \n number \n items { \n product_name \n quantity_shipped \n } \n } \n total { \n base_grand_total { \n value \n currency \n } \n grand_total { \n value \n currency \n } \n total_tax { \n value \n } \n subtotal { \n value \n currency \n } \n taxes { \n amount { \n value \n currency \n } \n title \n rate \n } \n total_shipping { \n value \n } \n shipping_handling { \n amount_including_tax { \n value \n } \n amount_excluding_tax { \n value \n } \n total_amount { \n value \n } \n taxes { \n amount { \n value \n } \n title \n rate \n } \n } \n discounts { \n amount { \n value \n currency \n } \n label \n } \n } \n } \n }\n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/if_orders.jmx - - - - shipments_id - $.data.customer.orders.items[0].shipments.id - NOT_FOUND - - BODY - - - - $.data.customer.orders.items - - false - false - false - false - - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":" { \n customerDownloadableProducts {\n items \n { \n date \n download_url \n order_increment_id \n remaining_downloads \n status \n } \n } \n }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/my_downloadable_products.jmx - - - - $.data.customerDownloadableProducts.items - - false - false - false - false - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":" { \n customer {\n wishlist \n { \n id \n items_count \n sharing_code \n updated_at \n } \n } \n }","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/my_wish_list.jmx - - - - $.data.customer.wishlist.items_count - - false - false - false - false - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - true - - - - false - {"query":"mutation {\n revokeCustomerToken {\n result \n }\n}","variables":null,"operationName":null} - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/logout.jmx - - - - $.data.revokeCustomerToken.result - true - true - false - false - false - - - - - false - - - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - tool/fragments/ce/common/return_email_to_pool.jmx - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - - - 1 - false - 1 - ${cAdminCMSManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin CMS Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_cms_management/admin_cms_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/ - GET - true - false - true - false - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/new - GET - true - false - true - false - false - - - - - - - - true - <p>CMS Content ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - content - - - true - - = - true - content_heading - - - true - ${admin_form_key} - = - true - form_key - - - true - - = - true - identifier - - - true - 1 - = - true - is_active - - - true - - = - true - layout_update_xml - - - true - - = - true - meta_description - - - true - - = - true - meta_keywords - - - true - - = - true - meta_title - - - false - {} - = - true - nodes_data - - - true - - = - true - node_ids - - - true - - = - true - page_id - - - true - 1column - = - true - page_layout - - - true - 0 - = - true - store_id[0] - - - true - CMS Title ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - title - - - true - 0 - = - true - website_root - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/save/ - POST - true - false - true - false - false - - - - - - You saved the page. - - Assertion.response_data - false - 16 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCMSManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminBrowseProductGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Browse Product Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Product"); - - pagesCount = parseInt(vars.get("products_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "product_listing"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_product_filter_text")); - vars.put("grid_filter_field", "name"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "name"); - vars.put("grid_sort_field_2", "price"); - vars.put("grid_sort_field_3", "attribute_set_id"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_products_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminBrowseOrderGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Browse Order Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Order"); - - pagesCount = parseInt(vars.get("orders_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "sales_order_grid"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_orders_filter_text")); - vars.put("grid_filter_field", "status"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "increment_id"); - vars.put("grid_sort_field_2", "created_at"); - vars.put("grid_sort_field_3", "billing_name"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_orders_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminProductCreationPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Create Product"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/once_only_controller.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(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom}); -} -relatedIndex = random.nextInt(props.get("simple_products_list").size()); -vars.put("related_product_id", props.get("simple_products_list").get(relatedIndex).get("id")); - - - true - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - - - - false - mycolor - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - false - attribute_code - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - false - mysize - = - true - searchCriteria[filterGroups][0][filters][1][value] - - - false - attribute_code - = - true - searchCriteria[filterGroups][0][filters][1][field] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/attributes - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/get_product_attributes.jmx - - - product_attributes - $.items - - - BODY - - - - javascript - - - - -var attributesData = JSON.parse(vars.get("product_attributes")), -maxOptions = 2; - -attributes = []; -for (i in attributesData) { - if (i >= 2) { - break; - } - var data = attributesData[i], - attribute = { - "id": data.attribute_id, - "code": data.attribute_code, - "label": data.default_frontend_label, - "options": [] - }; - - var processedOptions = 0; - for (optionN in data.options) { - var option = data.options[optionN]; - if (parseInt(option.value) > 0 && processedOptions < maxOptions) { - processedOptions++; - attribute.options.push(option); - } - } - attributes.push(attribute); -} - -vars.putObject("product_attributes", attributes); - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product_set/index/filter/${attribute_set_filter} - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx - - - - false - attribute_set_id - catalog&#x2F;product_set&#x2F;edit&#x2F;id&#x2F;([\d]+)&#x2F;"[\D\d]*Attribute Set 1 - $1$ - - 1 - - - - false - - - import org.apache.commons.codec.binary.Base64; - -byte[] encodedBytes = Base64.encodeBase64("set_name=Attribute Set 1".getBytes()); -vars.put("attribute_set_filter", new String(encodedBytes)); - - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - 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()); - -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")); - -do { - number1 = random.nextInt(props.get("simple_products_list_for_edit").size()); -} while(number == number1); -simpleList = props.get("simple_products_list_for_edit").get(number1); -vars.put("simple_product_2_id", simpleList.get("id")); -vars.put("simple_product_2_name", simpleList.get("title")); - -number2 = random.nextInt(props.get("configurable_products_list").size()); -configurableList = props.get("configurable_products_list").get(number2); -vars.put("configurable_product_1_id", configurableList.get("id")); -vars.put("configurable_product_1_url_key", configurableList.get("url_key")); -vars.put("configurable_product_1_name", configurableList.get("title")); - -//Additional category to be added -//int categoryId = Integer.parseInt(vars.get("simple_product_category_id")); -//vars.put("category_additional", (categoryId+1).toString()); -//New price -vars.put("price_new", "9999"); -//New special price -vars.put("special_price_new", "8888"); -//New quantity -vars.put("quantity_new", "100600"); -vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNum}-${__Random(1,1000000)}"); - - - - - true - tool/fragments/ce/admin_create_product/setup.jmx - - - - tool/fragments/ce/admin_create_product/create_bundle_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/bundle/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 42 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[configurable_variations] - - - true - 1 - = - true - affect_configurable_product_attributes - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - new-variations-attribute-set-id - - - true - 0 - = - true - product[shipment_type] - - - true - option title one - = - true - bundle_options[bundle_options][0][title] - - - true - - = - true - bundle_options[bundle_options][0][option_id] - - - true - - = - true - bundle_options[bundle_options][0][delete] - - - true - select - = - true - bundle_options[bundle_options][0][type] - - - true - 1 - = - true - bundle_options[bundle_options][0][required] - - - true - 0 - = - true - bundle_options[bundle_options][0][position] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][option_id] - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][0][bundle_selections][0][product_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][delete] - - - true - 25 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_value] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_type] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty] - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][0][position] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][option_id] - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][0][bundle_selections][1][product_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][delete] - - - true - 10.99 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_value] - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_type] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][position] - - - true - option title two - = - true - bundle_options[bundle_options][1][title] - - - true - - = - true - bundle_options[bundle_options][1][option_id] - - - true - - = - true - bundle_options[bundle_options][1][delete] - - - true - select - = - true - bundle_options[bundle_options][1][type] - - - true - 1 - = - true - bundle_options[bundle_options][1][required] - - - true - 1 - = - true - bundle_options[bundle_options][1][position] - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][option_id] - true - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][1][bundle_selections][0][product_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][delete] - true - - - true - 5.00 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_value] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_type] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][position] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][option_id] - true - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][1][bundle_selections][1][product_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][delete] - true - - - true - 7.00 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_value] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_type] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][position] - true - - - true - 2 - = - true - affect_bundle_product_selections - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 42 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full bundle product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[configurable_variations] - - - true - 1 - = - true - affect_configurable_product_attributes - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - new-variations-attribute-set-id - - - true - 0 - = - true - product[shipment_type] - false - - - true - option title one - = - true - bundle_options[bundle_options][0][title] - false - - - true - - = - true - bundle_options[bundle_options][0][option_id] - false - - - true - - = - true - bundle_options[bundle_options][0][delete] - false - - - true - select - = - true - bundle_options[bundle_options][0][type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][required] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][position] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][option_id] - false - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][0][bundle_selections][0][product_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][delete] - false - - - true - 25 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_value] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][0][position] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][option_id] - false - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][0][bundle_selections][1][product_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][delete] - false - - - true - 10.99 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][position] - false - - - true - option title two - = - true - bundle_options[bundle_options][1][title] - false - - - true - - = - true - bundle_options[bundle_options][1][option_id] - false - - - true - - = - true - bundle_options[bundle_options][1][delete] - false - - - true - select - = - true - bundle_options[bundle_options][1][type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][required] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][position] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][option_id] - false - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][1][bundle_selections][0][product_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][delete] - false - - - true - 5.00 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][position] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][option_id] - false - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][1][bundle_selections][1][product_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][delete] - false - - - true - 7.00 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][position] - false - - - true - 2 - = - true - affect_bundle_product_selections - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/bundle/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - option title one - option title two - ${simple_product_2_name} - ${simple_product_1_name} - - - Assertion.response_data - false - 2 - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/open_catalog_grid.jmx - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/${attribute_set_id}/type/configurable/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/new_configurable.jmx - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - ${admin_form_key} - = - true - form_key - true - - - true - ${attribute_set_id} - = - true - new-variations-attribute-set-id - true - - - true - 1 - = - true - product[affect_product_custom_options] - true - - - true - ${attribute_set_id} - = - true - product[attribute_set_id] - true - - - true - 4 - = - true - product[category_ids][0] - true - - - true - - = - true - product[custom_layout_update] - true - - - true - - = - true - product[description] - true - - - true - 0 - = - true - product[gift_message_available] - true - - - true - 1 - = - true - product[gift_wrapping_available] - true - - - true - - = - true - product[gift_wrapping_price] - true - - - true - - = - true - product[image] - true - - - true - 2 - = - true - product[is_returnable] - true - - - true - ${configurable_sku} - Meta Description - = - true - product[meta_description] - true - - - true - ${configurable_sku} - Meta Keyword - = - true - product[meta_keyword] - true - - - true - ${configurable_sku} - Meta Title - = - true - product[meta_title] - true - - - true - ${configurable_sku} - = - true - product[name] - true - - - true - container2 - = - true - product[options_container] - true - - - true - ${price_new} - = - true - product[price] - true - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - true - - - true - 1000 - = - true - product[quantity_and_stock_status][qty] - true - - - true - - = - true - product[short_description] - true - - - true - ${configurable_sku} - = - true - product[sku] - true - - - true - - = - true - product[small_image] - true - - - true - ${special_price_new} - = - true - product[special_price] - true - - - true - 1 - = - true - product[status] - true - - - true - 0 - = - true - product[stock_data][backorders] - true - - - true - 1 - = - true - product[stock_data][deferred_stock_update] - true - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - true - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - true - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - true - - - true - 1 - = - true - product[stock_data][manage_stock] - true - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - true - - - true - 0 - = - true - product[stock_data][min_qty] - true - - - true - 1 - = - true - product[stock_data][min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_backorders] - true - - - true - 1 - = - true - product[stock_data][use_config_deferred_stock_update] - true - - - true - 1 - = - true - product[stock_data][use_config_enable_qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - true - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - true - - - true - 2 - = - true - product[tax_class_id] - true - - - true - - = - true - product[thumbnail] - true - - - true - - = - true - product[url_key] - true - - - true - 1 - = - true - product[use_config_gift_message_available] - true - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - true - - - true - 1 - = - true - product[use_config_is_returnable] - true - - - true - 4 - = - true - product[visibility] - true - - - true - 1 - = - true - product[website_ids][1] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/${attribute_set_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_validate.jmx - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - javascript - - - - -attributes = vars.getObject("product_attributes"); - -for (i in attributes) { - var attribute = attributes[i]; - sampler.addArgument("attribute_codes[" + i + "]", attribute.code); - sampler.addArgument("attributes[" + i + "]", attribute.id); - sampler.addArgument("product[" + attribute.code + "]", attribute.options[0].value); - addConfigurableAttributeData(attribute); -} - -addConfigurableMatrix(attributes); - -function addConfigurableAttributeData(attribute) { - var attributeId = attribute.id; - - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attribute.code); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attribute.label); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][position]", 0); - attribute.options.forEach(function (option, index) { - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][include]", index); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][value_index]", option.value); - }); -} - -/** - * Build 4 simple products for Configurable - */ -function addConfigurableMatrix(attributes) { - - var attribute1 = attributes[0], - attribute2 = attributes[1], - productIndex = 1, - products = []; - var variationNames = []; - attribute1.options.forEach(function (option1) { - attribute2.options.forEach(function (option2) { - var productAttributes = {}, - namePart = option1.label + "+" + option2.label, - variationKey = option1.value + "-" + option2.value; - productAttributes[attribute1.code] = option1.value; - productAttributes[attribute2.code] = option2.value; - - variationNames.push(namePart + " - " + vars.get("configurable_sku")); - var product = { - "id": null, - "name": namePart + " - " + vars.get("configurable_sku"), - "sku": namePart + " - " + vars.get("configurable_sku"), - "status": 1, - "price": "100", - "price_currency": "$", - "price_string": "$100", - "weight": "6", - "qty": "50", - "variationKey": variationKey, - "configurable_attribute": JSON.stringify(productAttributes), - "thumbnail_image": "", - "media_gallery": {"images": {}}, - "image": [], - "was_changed": true, - "canEdit": 1, - "newProduct": 1, - "record_id": productIndex - }; - productIndex++; - products.push(product); - }); - }); - - sampler.addArgument("configurable-matrix-serialized", JSON.stringify(products)); - vars.putObject("configurable_variations_assertion", variationNames); -} - - tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - ${admin_form_key} - = - true - form_key - true - - - true - ${attribute_set_id} - = - true - new-variations-attribute-set-id - true - - - true - 1 - = - true - product[affect_product_custom_options] - true - - - true - ${attribute_set_id} - = - true - product[attribute_set_id] - true - - - true - 2 - = - true - product[category_ids][0] - true - - - true - - = - true - product[custom_layout_update] - true - - - true - - = - true - product[description] - true - - - true - 0 - = - true - product[gift_message_available] - true - - - true - 1 - = - true - product[gift_wrapping_available] - true - - - true - - = - true - product[gift_wrapping_price] - true - - - true - - = - true - product[image] - true - - - true - 2 - = - true - product[is_returnable] - true - - - true - ${configurable_sku} - Meta Description - = - true - product[meta_description] - true - - - true - ${configurable_sku} - Meta Keyword - = - true - product[meta_keyword] - true - - - true - ${configurable_sku} - Meta Title - = - true - product[meta_title] - true - - - true - ${configurable_sku} - = - true - product[name] - true - - - true - container2 - = - true - product[options_container] - true - - - true - ${price_new} - = - true - product[price] - true - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - true - - - true - 1000 - = - true - product[quantity_and_stock_status][qty] - true - - - true - - = - true - product[short_description] - true - - - true - ${configurable_sku} - = - true - product[sku] - true - - - true - - = - true - product[small_image] - true - - - true - ${special_price_new} - = - true - product[special_price] - true - - - true - 1 - = - true - product[status] - true - - - true - 0 - = - true - product[stock_data][backorders] - true - - - true - 1 - = - true - product[stock_data][deferred_stock_update] - true - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - true - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - true - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - true - - - true - 1 - = - true - product[stock_data][manage_stock] - true - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - true - - - true - 0 - = - true - product[stock_data][min_qty] - true - - - true - 1 - = - true - product[stock_data][min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_backorders] - true - - - true - 1 - = - true - product[stock_data][use_config_deferred_stock_update] - true - - - true - 1 - = - true - product[stock_data][use_config_enable_qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - true - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - true - - - true - 2 - = - true - product[tax_class_id] - true - - - true - - = - true - product[thumbnail] - true - - - true - - = - true - product[url_key] - true - - - true - 1 - = - true - product[use_config_gift_message_available] - true - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - true - - - true - 1 - = - true - product[use_config_is_returnable] - true - - - true - 4 - = - true - product[visibility] - true - - - true - 1 - = - true - product[website_ids][1] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/${attribute_set_id}/type/configurable/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_save.jmx - - - - You saved the product - - Assertion.response_data - false - 2 - - - - javascript - - - - -var configurableVariations = vars.getObject("configurable_variations_assertion"), -response = SampleResult.getResponseDataAsString(); - -configurableVariations.forEach(function (variation) { - if (response.indexOf(variation) == -1) { - AssertionResult.setFailureMessage("Cannot find variation \"" + variation + "\""); - AssertionResult.setFailure(true); - } -}); - - - - - - javascript - - - - -attributes = vars.getObject("product_attributes"); - -for (i in attributes) { - var attribute = attributes[i]; - sampler.addArgument("attribute_codes[" + i + "]", attribute.code); - sampler.addArgument("attributes[" + i + "]", attribute.id); - sampler.addArgument("product[" + attribute.code + "]", attribute.options[0].value); - addConfigurableAttributeData(attribute); -} - -addConfigurableMatrix(attributes); - -function addConfigurableAttributeData(attribute) { - var attributeId = attribute.id; - - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attribute.code); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attribute.label); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][position]", 0); - attribute.options.forEach(function (option, index) { - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][include]", index); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][value_index]", option.value); - }); -} - -/** - * Build 4 simple products for Configurable - */ -function addConfigurableMatrix(attributes) { - - var attribute1 = attributes[0], - attribute2 = attributes[1], - productIndex = 1, - products = []; - var variationNames = []; - attribute1.options.forEach(function (option1) { - attribute2.options.forEach(function (option2) { - var productAttributes = {}, - namePart = option1.label + "+" + option2.label, - variationKey = option1.value + "-" + option2.value; - productAttributes[attribute1.code] = option1.value; - productAttributes[attribute2.code] = option2.value; - - variationNames.push(namePart + " - " + vars.get("configurable_sku")); - var product = { - "id": null, - "name": namePart + " - " + vars.get("configurable_sku"), - "sku": namePart + " - " + vars.get("configurable_sku"), - "status": 1, - "price": "100", - "price_currency": "$", - "price_string": "$100", - "weight": "6", - "qty": "50", - "variationKey": variationKey, - "configurable_attribute": JSON.stringify(productAttributes), - "thumbnail_image": "", - "media_gallery": {"images": {}}, - "image": [], - "was_changed": true, - "canEdit": 1, - "newProduct": 1, - "record_id": productIndex - }; - productIndex++; - products.push(product); - }); - }); - - sampler.addArgument("configurable-matrix-serialized", JSON.stringify(products)); - vars.putObject("configurable_variations_assertion", variationNames); -} - - tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx - - - - - - tool/fragments/ce/admin_create_product/create_downloadable_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/downloadable/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - ${files_folder}downloadable_original.txt - links - text/plain - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/downloadable_file/upload/type/links/?isAjax=true - POST - false - false - true - true - false - - - - - original_file - $.file - - - BODY - - - - - - - - ${files_folder}downloadable_sample.txt - samples - text/plain - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/downloadable_file/upload/type/samples/?isAjax=true - POST - false - false - true - true - false - - - - - sample_file - $.file - - - BODY - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - on - = - true - is_downloadable - - - true - Links - = - true - product[links_title] - - - true - 0 - = - true - product[links_purchased_separately] - - - true - ${original_file} - = - true - downloadable[link][0][file][0][file] - false - - - true - downloadable_original.txt - = - true - downloadable[link][0][file][0][name] - false - - - true - 13 - = - true - downloadable[link][0][file][0][size] - false - - - true - new - = - true - downloadable[link][0][file][0][status] - false - - - true - 1 - = - true - downloadable[link][0][is_shareable] - - - true - 0 - = - true - downloadable[link][0][is_unlimited] - - - true - - = - true - downloadable[link][0][link_url] - - - true - 0 - = - true - downloadable[link][0][number_of_downloads] - true - - - true - 120 - = - true - downloadable[link][0][price] - true - - - true - 0 - = - true - downloadable[link][0][record_id] - true - - - true - file - = - true - downloadable[link][0][sample][type] - - - true - - = - true - downloadable[link][0][sample][url] - - - true - 1 - = - true - downloadable[link][0][sort_order] - - - true - Original Link - = - true - downloadable[link][0][title] - - - true - file - = - true - downloadable[link][0][type] - - - true - ${sample_file} - = - true - downloadable[sample][0][file][0][file] - true - - - true - downloadable_sample.txt - = - true - downloadable[sample][0][file][0][name] - true - - - true - 14 - = - true - downloadable[sample][0][file][0][size] - true - - - true - new - = - true - downloadable[sample][0][file][0][status] - true - - - true - 0 - = - true - downloadable[sample][0][record_id] - true - - - true - - = - true - downloadable[sample][0][sample_url] - true - - - true - 1 - = - true - downloadable[sample][0][sort_order] - true - - - true - Sample Link - = - true - downloadable[sample][0][title] - true - - - true - file - = - true - downloadable[sample][0][type] - true - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - 4 - = - true - new-variations-attribute-set-id - false - - - true - - = - true - product[configurable_variation] - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/type/downloadable/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - false - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - ${original_file} - = - true - downloadable[link][0][file][0][file] - false - - - true - downloadable_original.txt - = - true - downloadable[link][0][file][0][name] - false - - - true - 13 - = - true - downloadable[link][0][file][0][size] - false - - - true - new - = - true - downloadable[link][0][file][0][status] - false - - - true - 1 - = - true - downloadable[link][0][is_shareable] - true - - - true - 0 - = - true - downloadable[link][0][is_unlimited] - true - - - true - - = - true - downloadable[link][0][link_url] - true - - - true - 0 - = - true - downloadable[link][0][number_of_downloads] - false - - - true - 120 - = - true - downloadable[link][0][price] - false - - - true - 0 - = - true - downloadable[link][0][record_id] - false - - - true - file - = - true - downloadable[link][0][sample][type] - true - - - true - - = - true - downloadable[link][0][sample][url] - true - - - true - 1 - = - true - downloadable[link][0][sort_order] - true - - - true - Original Link - = - true - downloadable[link][0][title] - true - - - true - file - = - true - downloadable[link][0][type] - true - - - true - ${sample_file} - = - true - downloadable[sample][0][file][0][file] - true - - - true - downloadable_sample.txt - = - true - downloadable[sample][0][file][0][name] - true - - - true - 14 - = - true - downloadable[sample][0][file][0][size] - true - - - true - new - = - true - downloadable[sample][0][file][0][status] - true - - - true - 0 - = - true - downloadable[sample][0][record_id] - true - - - true - - = - true - downloadable[sample][0][sample_url] - true - - - true - 1 - = - true - downloadable[sample][0][sort_order] - true - - - true - Sample Link - = - true - downloadable[sample][0][title] - true - - - true - file - = - true - downloadable[sample][0][type] - true - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - 4 - = - true - new-variations-attribute-set-id - false - - - true - - = - true - product[configurable_variation] - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/downloadable/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - violation - - Assertion.response_data - false - 6 - - - - - - - tool/fragments/ce/admin_create_product/create_simple_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/simple/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - product[options][1][is_delete] - false - - - true - 1 - = - true - product[options][1][is_require] - false - - - true - select - = - true - product[options][1][previous_group] - false - - - true - drop_down - = - true - product[options][1][previous_type] - false - - - true - 0 - = - true - product[options][1][sort_order] - false - - - true - Product Option Title One - = - true - product[options][1][title] - false - - - true - drop_down - = - true - product[options][1][type] - false - - - true - - = - true - product[options][1][values][1][is_delete] - false - - - true - 200 - = - true - product[options][1][values][1][price] - false - - - true - fixed - = - true - product[options][1][values][1][price_type] - false - - - true - sku-one - = - true - product[options][1][values][1][sku] - false - - - true - 0 - = - true - product[options][1][values][1][sort_order] - false - - - true - Row Title - = - true - product[options][1][values][1][title] - false - - - true - - = - true - product[options][2][is_delete] - false - - - true - 1 - = - true - product[options][2][is_require] - false - - - true - 250 - = - true - product[options][2][max_characters] - false - - - true - text - = - true - product[options][2][previous_group] - false - - - true - field - = - true - product[options][2][previous_type] - false - - - true - 500 - = - true - product[options][2][price] - false - - - true - fixed - = - true - product[options][2][price_type] - false - - - true - sku-two - = - true - product[options][2][sku] - false - - - true - 1 - = - true - product[options][2][sort_order] - false - - - true - Field Title - = - true - product[options][2][title] - false - - - true - field - = - true - product[options][2][type] - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - 4 - = - true - new-variations-attribute-set-id - true - - - true - - = - true - product[configurable_variation] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full simple product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - product[options][1][is_delete] - true - - - true - 1 - = - true - product[options][1][is_require] - - - true - select - = - true - product[options][1][previous_group] - false - - - true - drop_down - = - true - product[options][1][previous_type] - false - - - true - 0 - = - true - product[options][1][sort_order] - false - - - true - Product Option Title One - = - true - product[options][1][title] - - - true - drop_down - = - true - product[options][1][type] - - - true - - = - true - product[options][1][values][1][is_delete] - false - - - true - 200 - = - true - product[options][1][values][1][price] - - - true - fixed - = - true - product[options][1][values][1][price_type] - - - true - sku-one - = - true - product[options][1][values][1][sku] - - - true - 0 - = - true - product[options][1][values][1][sort_order] - - - true - Row Title - = - true - product[options][1][values][1][title] - - - true - - = - true - product[options][2][is_delete] - false - - - true - 1 - = - true - product[options][2][is_require] - - - true - 250 - = - true - product[options][2][max_characters] - - - true - text - = - true - product[options][2][previous_group] - - - true - field - = - true - product[options][2][previous_type] - - - true - 500 - = - true - product[options][2][price] - - - true - fixed - = - true - product[options][2][price_type] - - - true - sku-two - = - true - product[options][2][sku] - - - true - 1 - = - true - product[options][2][sort_order] - - - true - Field Title - = - true - product[options][2][title] - - - true - field - = - true - product[options][2][type] - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - 4 - = - true - new-variations-attribute-set-id - true - - - true - - = - true - product[configurable_variation] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/simple/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - violation - - Assertion.response_data - false - 6 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminProductEditingPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Edit Product"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.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) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - simpleCount = props.get("simple_products_list_for_edit").size(); - configCount = props.get("configurable_products_list_for_edit").size(); - productCount = 0; - if (simpleCount > configCount) { - productCount = configCount; - } else { - productCount = simpleCount; - } - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - threadsNumber = 1; - } - //Current thread number starts from 0 - currentThreadNum = ctx.getThreadNum(); - - String siterator = vars.get("threadIterator_" + currentThreadNum.toString()); - iterator = 0; - if(siterator == null){ - vars.put("threadIterator_" + currentThreadNum.toString() , "0"); - } else { - iterator = Integer.parseInt(siterator); - iterator ++; - vars.put("threadIterator_" + currentThreadNum.toString() , iterator.toString()); - } - - //Number of products for one thread - productClusterLength = productCount / threadsNumber; - - if (iterator >= productClusterLength) { - vars.put("threadIterator_" + currentThreadNum.toString(), "0"); - iterator = 0; - } - - //Index of the current product from the cluster - i = productClusterLength * currentThreadNum + iterator; - - //ids of simple and configurable products to edit - vars.put("simple_product_id", props.get("simple_products_list_for_edit").get(i).get("id")); - vars.put("configurable_product_id", props.get("configurable_products_list_for_edit").get(i).get("id")); - - //id of related product - do { - relatedIndex = random.nextInt(props.get("simple_products_list_for_edit").size()); - } while(i == relatedIndex); - vars.put("related_product_id", props.get("simple_products_list_for_edit").get(relatedIndex).get("id")); - } catch (Exception ex) { - log.info("Script execution failed", ex); -} - - - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/edit/id/${simple_product_id}/ - GET - true - false - true - false - false - - - - - - Product - - Assertion.response_data - false - 16 - - - - false - simple_product_name - ,"name":"([^'"]+)", - $1$ - - 1 - - - - false - simple_product_sku - ,"sku":"([^'"]+)", - $1$ - - 1 - - - - false - simple_product_category_id - ,"category_ids":."(\d+)". - $1$ - - 1 - - - - - Passing arguments between threads - //Additional category to be added - import java.util.Random; - - Random randomGenerator = new Random(); - int newCategoryId; - if (${seedForRandom} > 0) { - randomGenerator.setSeed(${seedForRandom} + ${__threadNum}); - } - - int categoryId = Integer.parseInt(vars.get("simple_product_category_id")); - categoryList = props.get("admin_category_ids_list"); - - if (categoryList.size() > 1) { - do { - int index = randomGenerator.nextInt(categoryList.size()); - newCategoryId = Integer.parseInt(categoryList.get(index)); - } while (categoryId == newCategoryId); - - vars.put("category_additional", newCategoryId.toString()); - } - - //New price - vars.put("price_new", "9999"); - //New special price - vars.put("special_price_new", "8888"); - //New quantity - vars.put("quantity_new", "100600"); - - - - false - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${simple_product_name} - = - true - product[name] - false - - - true - ${simple_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - ${quantity_new} - = - true - product[quantity_and_stock_status][qty] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 1.0000 - = - true - product[weight] - false - - - true - 1 - = - true - product[product_has_weight] - false - - - true - ${simple_product_category_id} - = - true - product[category_ids][] - false - - - true - <p>Full simple product Description ${simple_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - - = - true - product[configurable_variations] - false - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - - = - true - product[image] - false - - - true - - = - true - product[small_image] - false - - - true - - = - true - product[thumbnail] - false - - - true - ${simple_product_name} - = - true - product[url_key] - false - - - true - ${simple_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${simple_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${simple_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - ${quantity_new} - = - true - product[stock_data][original_inventory_qty] - false - - - true - ${quantity_new} - = - true - product[stock_data][qty] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - - = - true - new-variations-attribute-set-id - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/id/${simple_product_id}/?isAjax=true - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${simple_product_name} - = - true - product[name] - false - - - true - ${simple_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - ${quantity_new} - = - true - product[quantity_and_stock_status][qty] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 1.0000 - = - true - product[weight] - false - - - true - 1 - = - true - product[product_has_weight] - false - - - true - ${simple_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - - - true - <p>Full simple product Description ${simple_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - - = - true - product[configurable_variations] - false - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - - = - true - product[image] - false - - - true - - = - true - product[small_image] - false - - - true - - = - true - product[thumbnail] - false - - - true - ${simple_product_name} - = - true - product[url_key] - false - - - true - ${simple_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${simple_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${simple_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - ${quantity_new} - = - true - product[stock_data][original_inventory_qty] - false - - - true - ${quantity_new} - = - true - product[stock_data][qty] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - - = - true - new-variations-attribute-set-id - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/id/${simple_product_id}/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/edit/id/${configurable_product_id}/ - GET - true - false - true - false - false - - - - - - Product - - Assertion.response_data - false - 16 - - - - false - configurable_product_name - ,"name":"([^'"]+)", - $1$ - - 1 - - - - false - configurable_product_sku - ,"sku":"([^'"]+)", - $1$ - - 1 - - - - false - configurable_product_category_id - ,"category_ids":."(\d+)" - $1$ - - 1 - - - - false - configurable_attribute_id - ,"configurable_variation":"([^'"]+)", - $1$ - - 1 - true - - - - false - configurable_matrix - "configurable-matrix":(\[.*?\]) - $1$ - - 1 - true - - - - associated_products_ids - $.[*].id - - configurable_matrix - VAR - - - - false - configurable_product_data - (\{"product":.*?configurable_attributes_data.*?\})\s*< - $1$ - - 1 - - - - configurable_attributes_data - $.product.configurable_attributes_data - - configurable_product_data - VAR - - - - false - configurable_attribute_ids - "attribute_id":"(\d+)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_codes - "code":"(\w+)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_labels - "label":"(.*?)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_values - "values":(\{(?:\}|.*?\}\})) - $1$ - - -1 - variable - configurable_attributes_data - - - - - configurable_attribute_ids - configurable_attribute_id - true - - - - 1 - ${configurable_attribute_ids_matchNr} - 1 - attribute_counter - - true - true - - - - return vars.get("configurable_attribute_values_" + vars.get("attribute_counter")); - - - false - - - - false - attribute_${configurable_attribute_id}_values - "value_index":"(\d+)" - $1$ - - -1 - configurable_attribute_values_${attribute_counter} - - - - - - - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${configurable_product_name} - = - true - product[name] - false - - - true - ${configurable_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 3 - = - true - product[weight] - false - - - true - ${configurable_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - false - - - true - <p>Configurable product description ${configurable_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - ${configurable_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${configurable_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${configurable_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - ${configurable_attribute_id} - = - true - product[configurable_variation] - false - - - true - ${configurable_product_name} - = - true - product[url_key] - - - true - 1 - = - true - product[use_config_gift_message_available] - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - - - true - 4 - = - true - product[visibility] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 50 - = - true - product[stock_data][qty] - false - - - true - configurable - = - true - product[stock_data][type_id] - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/id/${configurable_product_id}/ - POST - true - false - true - false - false - - - - - false - - - try { - int attributesCount = Integer.parseInt(vars.get("configurable_attribute_ids_matchNr")); - for (int i = 1; i <= attributesCount; i++) { - attributeId = vars.get("configurable_attribute_ids_" + i.toString()); - attributeCode = vars.get("configurable_attribute_codes_" + i.toString()); - attributeLabel = vars.get("configurable_attribute_labels_" + i.toString()); - ctx.getCurrentSampler().addArgument("attributes[" + (i - 1).toString() + "]", attributeId); - ctx.getCurrentSampler().addArgument("attribute_codes[" + (i - 1).toString() + "]", attributeCode); - ctx.getCurrentSampler().addArgument("product[" + attributeCode + "]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][position]", (i - 1).toString()); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attributeCode); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attributeLabel); - - int valuesCount = Integer.parseInt(vars.get("attribute_" + attributeId + "_values_matchNr")); - for (int j = 1; j <= valuesCount; j++) { - attributeValue = vars.get("attribute_" + attributeId + "_values_" + j.toString()); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][include]", - "1" - ); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][value_index]", - attributeValue - ); - } - } - ctx.getCurrentSampler().addArgument("associated_product_ids_serialized", vars.get("associated_products_ids").toString()); - } catch (Exception e) { - log.error("error???", e); - } - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${configurable_product_name} - = - true - product[name] - false - - - true - ${configurable_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id]admin - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 3 - = - true - product[weight] - false - - - true - ${configurable_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - false - - - true - <p>Configurable product description ${configurable_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - ${configurable_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${configurable_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${configurable_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - ${configurable_attribute_id} - = - true - product[configurable_variation] - false - - - true - ${configurable_product_name} - = - true - product[url_key] - - - true - 1 - = - true - product[use_config_gift_message_available] - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - - - true - 4 - = - true - product[visibility] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 50 - = - true - product[stock_data][qty] - false - - - true - configurable - = - true - product[stock_data][type_id] - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/id/${configurable_product_id}/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - false - - - try { - int attributesCount = Integer.parseInt(vars.get("configurable_attribute_ids_matchNr")); - for (int i = 1; i <= attributesCount; i++) { - attributeId = vars.get("configurable_attribute_ids_" + i.toString()); - attributeCode = vars.get("configurable_attribute_codes_" + i.toString()); - attributeLabel = vars.get("configurable_attribute_labels_" + i.toString()); - ctx.getCurrentSampler().addArgument("attributes[" + (i - 1).toString() + "]", attributeId); - ctx.getCurrentSampler().addArgument("attribute_codes[" + (i - 1).toString() + "]", attributeCode); - ctx.getCurrentSampler().addArgument("product[" + attributeCode + "]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][position]", (i - 1).toString()); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attributeCode); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attributeLabel); - - int valuesCount = Integer.parseInt(vars.get("attribute_" + attributeId + "_values_matchNr")); - for (int j = 1; j <= valuesCount; j++) { - attributeValue = vars.get("attribute_" + attributeId + "_values_" + j.toString()); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][include]", - "1" - ); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][value_index]", - attributeValue - ); - } - } - ctx.getCurrentSampler().addArgument("associated_product_ids_serialized", vars.get("associated_products_ids").toString()); - } catch (Exception e) { - log.error("error???", e); - } - - - - - You saved the product - - Assertion.response_data - false - 2 - if have trouble see messages-message-error - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminReturnsManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Returns Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/orders_page.jmx - - - - Create New Order - - Assertion.response_data - false - 2 - - - - - - - - - true - sales_order_grid - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 200 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - increment_id - = - true - sorting[field] - - - true - desc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - false - - - true - pending - = - true - filters[status] - true - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - sales_order_grid - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - 200 - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - increment_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - true - pending - = - true - filters[status] - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/search_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - false - order_numbers - \"increment_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - false - order_ids - \"entity_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - - - tool/fragments/ce/admin_create_process_returns/setup.jmx - - import java.util.ArrayList; - import java.util.HashMap; - import org.apache.jmeter.protocol.http.util.Base64Encoder; - import java.util.Random; - - // get count of "order_numbers" variable defined in "Search Pending Orders Limit" - int ordersCount = Integer.parseInt(vars.get("order_numbers_matchNr")); - - - int clusterLength; - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - //Number of orders for one thread - clusterLength = ordersCount; - } else { - clusterLength = Math.round(ordersCount / threadsNumber); - if (clusterLength == 0) { - clusterLength = 1; - } - } - - //Current thread number starts from 0 - int currentThreadNum = ctx.getThreadNum(); - - //Index of the current product from the cluster - Random random = new Random(); - if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - int iterator = random.nextInt(clusterLength); - if (iterator == 0) { - iterator = 1; - } - - int i = clusterLength * currentThreadNum + iterator; - - orderNumber = vars.get("order_numbers_" + i.toString()); - orderId = vars.get("order_ids_" + i.toString()); - vars.put("order_number", orderNumber); - vars.put("order_id", orderId); - - - - - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/view/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_order.jmx - - - - #${order_number} - - Assertion.response_data - false - 2 - - - - false - order_status - <span id="order_status">([^<]+)</span> - $1$ - - 1 - simple_products - - - - - - "${order_status}" == "Pending" - false - tool/fragments/ce/admin_edit_order/if_controller.jmx - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_start.jmx - - - - Invoice Totals - - Assertion.response_data - false - 2 - - - - false - item_ids - <div id="order_item_(\d+)_title"\s*class="product-title"> - $1$ - - -1 - simple_products - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - invoice[items][${item_ids_1}] - - - true - 1 - = - true - invoice[items][${item_ids_2}] - - - true - Invoiced - = - true - invoice[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx - - - - The invoice has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_creditmemo/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx - - - - New Memo - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - creditmemo[items][${item_ids_1}][qty] - - - true - 1 - = - true - creditmemo[items][${item_ids_2}][qty] - - - true - 1 - = - true - creditmemo[do_offline] - - - true - Credit Memo added - = - true - creditmemo[comment_text] - - - true - 10 - = - true - creditmemo[shipping_amount] - - - true - 0 - = - true - creditmemo[adjustment_positive] - - - true - 0 - = - true - creditmemo[adjustment_negative] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_creditmemo/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx - - - - You created the credit memo - - Assertion.response_data - false - 2 - - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))} - tool/fragments/ce/admin_create_process_returns/pause.jmx - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminBrowseCustomerGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Browse Customer Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Customer"); - - pagesCount = parseInt(vars.get("customers_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "customer_listing"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_customer_filter_text")); - vars.put("grid_filter_field", "name"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "name"); - vars.put("grid_sort_field_2", "group_id"); - vars.put("grid_sort_field_3", "billing_country_id"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_customers_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminCreateOrderPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Create Order"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.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(); - -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); -simpleList = props.get("simple_products_list").get(number1); -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")); - - -customers_index = 0; -if (!props.containsKey("customer_ids_index")) { - props.put("customer_ids_index", customers_index); -} - -try { - customers_index = props.get("customer_ids_index"); - customers_list = props.get("customer_ids_list"); - - if (customers_index == customers_list.size()) { - customers_index=0; - } - vars.put("customer_id", customers_list.get(customers_index)); - props.put("customer_ids_index", ++customers_index); -} -catch (java.lang.Exception e) { - log.error("Caught Exception in 'Admin Create Order' thread."); - SampleResult.setStopThread(true); -} - - - true - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/start/ - GET - true - false - true - false - false - - Detected the start of a redirect chain - - - - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${configurable_product_1_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - true - item[${simple_product_1_id}][qty] - 1 - = - true - - - true - item[${simple_product_2_id}][qty] - 1 - = - true - - - true - item[${configurable_product_1_id}][qty] - 1 - = - true - - - true - customer_id - ${customer_id} - = - true - - - true - store_id - 1 - = - true - - - true - currency_id - - = - true - - - true - form_key - ${admin_form_key} - = - true - - - true - payment[method] - checkmo - = - true - - - true - reset_shipping - 1 - = - true - - - true - json - 1 - = - true - - - true - as_js_varname - iFrameResponse - = - true - - - true - form_key - ${admin_form_key} - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/loadBlock/block/search,items,shipping_method,totals,giftmessage,billing_method?isAjax=true - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - false - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - - ctx.getCurrentSampler().addArgument("item[" + vars.get("configurable_product_1_id") + "][super_attribute][" + attribute_ids_array[i] + "]", option_values_array[i]); - } -} catch (Exception e) { - log.error("error???", e); -} - - - - - - - - true - collect_shipping_rates - 1 - = - true - - - true - customer_id - ${customer_id} - = - true - - - true - store_id - 1 - = - true - - - true - currency_id - false - = - true - - - true - form_key - ${admin_form_key} - = - true - - - true - payment[method] - checkmo - = - true - - - true - json - true - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/loadBlock/block/shipping_method,totals?isAjax=true - POST - true - false - true - false - false - - - - - - shipping_method - Flat Rate - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/index/ - GET - true - false - true - false - false - - Detected the start of a redirect chain - - - - - Select from existing customer addresses - Submit Order - Items Ordered - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - limit - 20 - = - true - - - true - entity_id - - = - true - - - true - name - - = - true - - - true - email - - = - true - - - true - Telephone - - = - true - - - true - billing_postcode - - = - true - - - true - billing_country_id - - = - true - - - true - billing_regione - - = - true - - - true - store_name - - = - true - - - true - page - 1 - = - true - - - true - order[currency] - USD - = - true - - - true - sku - - = - true - - - true - qty - - = - true - - - true - limit - 20 - = - true - - - true - entity_id - - = - true - - - true - name - - = - true - - - true - sku - - = - true - - - true - price[from] - - = - true - - - true - price[to] - - = - true - - - true - in_products - - = - true - - - true - page - 1 - = - true - - - true - coupon_code - - = - true - - - true - order[account][group_id] - 1 - = - true - - - true - order[account][email] - user_${customer_id}@example.com - = - true - - - true - order[billing_address][customer_address_id] - - = - true - - - true - order[billing_address][prefix] - - = - true - - - true - order[billing_address][firstname] - Anthony - = - true - - - true - order[billing_address][middlename] - - = - true - - - true - order[billing_address][lastname] - Nealy - = - true - - - true - order[billing_address][suffix] - - = - true - - - true - order[billing_address][company] - - = - true - - - true - order[billing_address][street][0] - 123 Freedom Blvd. #123 - = - true - - - true - order[billing_address][street][1] - - = - true - - - true - order[billing_address][city] - Fayetteville - = - true - - - true - order[billing_address][country_id] - US - = - true - - - true - order[billing_address][region] - - = - true - - - true - order[billing_address][region_id] - ${alabama_region_id} - = - true - - - true - order[billing_address][postcode] - 123123 - = - true - - - true - order[billing_address][telephone] - 022-333-4455 - = - true - - - true - order[billing_address][fax] - - = - true - - - true - order[billing_address][vat_id] - - = - true - - - true - shipping_same_as_billing - on - = - true - - - true - payment[method] - checkmo - = - true - - - true - order[shipping_method] - flatrate_flatrate - = - true - - - true - order[comment][customer_note] - - = - true - - - true - order[comment][customer_note_notify] - 1 - = - true - - - true - order[send_confirmation] - 1 - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/save/ - POST - true - false - true - true - false - - Detected the start of a redirect chain - - - - false - order_id - ${host}${base_path}${admin_path}/sales/order/index/order_id/(\d+)/ - $1$ - - 1 - - - - false - order_item_1 - order_item_(\d+)_title - $1$ - - 1 - - - - false - order_item_2 - order_item_(\d+)_title - $1$ - - 2 - - - - false - order_item_3 - order_item_(\d+)_title - $1$ - - 3 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_2 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_3 - - - - - You created the order. - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - invoice[items][${order_item_1}] - 1 - = - true - - - true - invoice[items][${order_item_2}] - 1 - = - true - - - true - invoice[items][${order_item_3}] - 1 - = - true - - - true - invoice[comment_text] - - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - - The invoice has been created. - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - shipment[items][${order_item_1}] - 1 - = - true - - - true - shipment[items][${order_item_2}] - 1 - = - true - - - true - shipment[items][${order_item_3}] - 1 - = - true - - - true - shipment[comment_text] - - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/ - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - - The shipment has been created. - - Assertion.response_data - false - 2 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminCategoryManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Category Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_category_management/admin_category_management.jmx - - - - javascript - - - - random = new java.util.Random(); -if (${seedForRandom} > 0) { -random.setSeed(${seedForRandom} + ${__threadNum}); -} - -/** - * Get unique ids for fix concurrent category saving - */ -function getNextProductNumber(i) { - number = productsVariationsSize * ${__threadNum} - i; - if (number >= productsSize) { - log.info("${testLabel}: capacity of product list is not enough for support all ${adminPoolUsers} threads"); - return random.nextInt(productsSize); - } - return productsVariationsSize * ${__threadNum} - i; -} - -var productsVariationsSize = 5, - productsSize = props.get("simple_products_list_for_edit").size(); - - -for (i = 1; i<= productsVariationsSize; i++) { - var productVariablePrefix = "simple_product_" + i + "_"; - number = getNextProductNumber(i); - simpleList = props.get("simple_products_list_for_edit").get(number); - - vars.put(productVariablePrefix + "url_key", simpleList.get("url_key")); - vars.put(productVariablePrefix + "id", simpleList.get("id")); - vars.put(productVariablePrefix + "name", simpleList.get("title")); -} - -categoryIndex = random.nextInt(props.get("admin_category_ids_list").size()); -vars.put("parent_category_id", props.get("admin_category_ids_list").get(categoryIndex)); -do { -categoryIndexNew = random.nextInt(props.get("admin_category_ids_list").size()); -} while(categoryIndex == categoryIndexNew); -vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(categoryIndexNew)); - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/edit/id/${parent_category_id}/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/add/store/0/parent/${parent_category_id} - GET - true - false - true - false - false - - - - - - <title>New Category - - Assertion.response_data - false - 2 - - - - - - - - true - - = - true - id - - - true - ${parent_category_id} - = - true - parent - - - true - - = - true - path - - - true - - = - true - store_id - - - true - 0 - = - true - is_active - - - true - 0 - = - true - include_in_menu - - - true - 1 - = - true - is_anchor - - - true - true - = - true - use_config[available_sort_by] - - - true - true - = - true - use_config[default_sort_by] - - - true - true - = - true - use_config[filter_price_range] - - - true - false - = - true - use_default[url_key] - - - true - 0 - = - true - url_key_create_redirect - - - true - 0 - = - true - custom_use_parent_settings - - - true - 0 - = - true - custom_apply_to_products - - - true - Admin Category Management ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - name - - - true - admin-category-management-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - url_key - - - true - - = - true - meta_title - - - true - - = - true - description - - - true - PRODUCTS - = - true - display_mode - - - true - position - = - true - default_sort_by - - - true - - = - true - meta_keywords - - - true - - = - true - meta_description - - - true - - = - true - custom_layout_update - - - false - {"${simple_product_1_id}":"","${simple_product_2_id}":"","${simple_product_3_id}":"","${simple_product_4_id}":"","${simple_product_5_id}":""} - = - true - category_products - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/save/ - POST - true - false - true - false - false - - - - - URL - admin_category_id - /catalog/category/edit/id/(\d+)/ - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_id - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/edit/id/${admin_category_id}/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - false - admin_category_entity_id - "entity_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_attribute_set_id - "attribute_set_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_parent_id - "parent_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_created_at - "created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_updated_at - "updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_path - "entity_id":(.+)"path":"([^\"]+)" - $2$ - - 1 - - - - false - admin_category_level - "level":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_name - "entity_id":(.+)"name":"([^"]+)" - $2$ - - 1 - - - - false - admin_category_url_key - "url_key":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_url_path - "url_path":"([^"]+)" - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_entity_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_attribute_set_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_parent_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_updated_at - - - - - ^[\d\\\/]+$ - - Assertion.response_data - false - 1 - variable - admin_category_path - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_level - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_name - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_url_key - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_url_path - - - - - ${simple_product_1_name} - ${simple_product_2_name} - ${simple_product_3_name} - ${simple_product_4_name} - ${simple_product_5_name} - - Assertion.response_data - false - 2 - - - - - - - - true - ${admin_category_id} - = - true - id - - - true - ${admin_form_key} - = - true - form_key - - - true - append - = - true - point - - - true - ${new_parent_category_id} - = - true - pid - - - true - ${parent_category_id} - = - true - paid - - - true - 0 - = - true - aid - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/move/ - POST - true - false - true - false - false - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/delete/id/${admin_category_id}/ - POST - true - false - true - false - false - - - - - - You deleted the category. - - Assertion.response_data - false - 2 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCategoryManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminPromotionRulesPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Promotion Rules"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/ - GET - true - false - true - false - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/new - GET - true - false - true - false - false - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - true - - - true - 1--1 - = - true - id - - - true - Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal - = - true - type - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/newConditionHtml/form/sales_rule_formrule_conditions_fieldset_/form_namespace/sales_rule_form - POST - true - false - true - false - false - - - - - - - - true - Rule Name ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - name - - - true - 0 - = - true - is_active - - - true - 0 - = - true - use_auto_generation - - - true - 1 - = - true - is_rss - - - true - 0 - = - true - apply_to_shipping - - - true - 0 - = - true - stop_rules_processing - - - true - - = - true - coupon_code - - - true - - = - true - uses_per_coupon - - - true - - = - true - uses_per_customer - - - true - - = - true - sort_order - - - true - 5 - = - true - discount_amount - - - true - 0 - = - true - discount_qty - - - true - - = - true - discount_step - - - true - - = - true - reward_points_delta - - - true - - = - true - store_labels[0] - - - true - Rule Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - description - - - true - 1 - = - true - coupon_type - - - true - cart_fixed - = - true - simple_action - - - true - 1 - = - true - website_ids[0] - - - true - 0 - = - true - customer_group_ids[0] - - - true - - = - true - from_date - - - true - - = - true - to_date - - - true - Magento\SalesRule\Model\Rule\Condition\Combine - = - true - rule[conditions][1][type] - - - true - all - = - true - rule[conditions][1][aggregator] - - - true - 1 - = - true - rule[conditions][1][value] - - - true - Magento\SalesRule\Model\Rule\Condition\Address - = - true - rule[conditions][1--1][type] - - - true - base_subtotal - = - true - rule[conditions][1--1][attribute] - - - true - >= - = - true - rule[conditions][1--1][operator] - - - true - 100 - = - true - rule[conditions][1--1][value] - - - true - - = - true - rule[conditions][1][new_chlid] - - - true - Magento\SalesRule\Model\Rule\Condition\Product\Combine - = - true - rule[actions][1][type] - - - true - all - = - true - rule[actions][1][aggregator] - - - true - 1 - = - true - rule[actions][1][value] - - - true - - = - true - rule[actions][1][new_child] - - - true - - = - true - store_labels[1] - - - true - - = - true - store_labels[2] - - - true - - = - true - related_banners - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/save/ - POST - true - false - true - false - false - - - - - - You saved the rule. - - Assertion.response_data - false - 16 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminPromotionsManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminCustomerManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Customer Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_customer_management/admin_customer_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - true - customer_listing - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 20 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - - - true - customer_listing - = - true - namespace - - - true - Lastname - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 20 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - false - customer_edit_url_path - actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/", - /customer/index/edit/id/$2$/ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - customer_edit_url_path - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}${customer_edit_url_path} - GET - true - false - true - false - false - - - - - - Customer Information - - Assertion.response_data - false - 2 - - - - false - admin_customer_entity_id - "entity_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_website_id - "website_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_firstname - "firstname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_lastname - "lastname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_email - "email":"([^\@]+@[^.]+.[^"]+)" - $1$ - - 1 - - - - false - admin_customer_group_id - "group_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_store_id - "store_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_created_at - "created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_updated_at - "updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_is_active - "is_active":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_disable_auto_group_change - "disable_auto_group_change":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_created_in - "created_in":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_dob - "dob":"(\d+)-(\d+)-(\d+)" - $2$/$3$/$1$ - - 1 - - - - false - admin_customer_default_billing - "default_billing":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_default_shipping - "default_shipping":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_gender - "gender":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_failures_num - "failures_num":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_address_entity_id - _address":\{"entity_id":"(\d+)".+?"parent_id":"${admin_customer_entity_id}" - $1$ - - 1 - - - - false - admin_customer_address_created_at - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_updated_at - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_is_active - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"is_active":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_address_city - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"city":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_country_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"country_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_firstname - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"firstname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_lastname - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"lastname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_postcode - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"postcode":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_region - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_region_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_street - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"street":\["([^"]+)"\] - $1$ - - 1 - - - - false - admin_customer_address_telephone - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"telephone":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_customer_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"customer_id":"([^"]+)" - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_entity_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_website_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_firstname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_lastname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_email - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_group_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_store_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_updated_at - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_is_active - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_disable_auto_group_change - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_created_in - - - - - ^\d+/\d+/\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_dob - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_default_billing - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_default_shipping - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_gender - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_failures_num - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_entity_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_updated_at - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_is_active - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_city - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_country_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_firstname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_lastname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_postcode - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_region - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_region_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_street - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_telephone - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_customer_id - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_customer_entity_id} - = - true - customer[entity_id] - - - true - ${admin_customer_website_id} - = - true - customer[website_id] - - - true - ${admin_customer_email} - = - true - customer[email] - - - true - ${admin_customer_group_id} - = - true - customer[group_id] - - - true - ${admin_customer_store_id} - = - true - customer[store_id] - - - true - ${admin_customer_created_at} - = - true - customer[created_at] - - - true - ${admin_customer_updated_at} - = - true - customer[updated_at] - - - true - ${admin_customer_is_active} - = - true - customer[is_active] - - - true - ${admin_customer_disable_auto_group_change} - = - true - customer[disable_auto_group_change] - - - true - ${admin_customer_created_in} - = - true - customer[created_in] - - - true - - = - true - customer[prefix] - - - true - ${admin_customer_firstname} 1 - = - true - customer[firstname] - - - true - - = - true - customer[middlename] - - - true - ${admin_customer_lastname} 1 - = - true - customer[lastname] - - - true - - = - true - customer[suffix] - - - true - ${admin_customer_dob} - = - true - customer[dob] - - - true - ${admin_customer_default_billing} - = - true - customer[default_billing] - - - true - ${admin_customer_default_shipping} - = - true - customer[default_shipping] - - - true - - = - true - customer[taxvat] - - - true - ${admin_customer_gender} - = - true - customer[gender] - - - true - ${admin_customer_failures_num} - = - true - customer[failures_num] - - - true - ${admin_customer_store_id} - = - true - customer[sendemail_store_id] - - - true - ${admin_customer_address_entity_id} - = - true - address[${admin_customer_address_entity_id}][entity_id] - - - true - ${admin_customer_address_created_at} - = - true - address[${admin_customer_address_entity_id}][created_at] - - - true - ${admin_customer_address_updated_at} - = - true - address[${admin_customer_address_entity_id}][updated_at] - - - true - ${admin_customer_address_is_active} - = - true - address[${admin_customer_address_entity_id}][is_active] - - - true - ${admin_customer_address_city} - = - true - address[${admin_customer_address_entity_id}][city] - - - true - - = - true - address[${admin_customer_address_entity_id}][company] - - - true - ${admin_customer_address_country_id} - = - true - address[${admin_customer_address_entity_id}][country_id] - - - true - ${admin_customer_address_firstname} - = - true - address[${admin_customer_address_entity_id}][firstname] - - - true - ${admin_customer_address_lastname} - = - true - address[${admin_customer_address_entity_id}][lastname] - - - true - - = - true - address[${admin_customer_address_entity_id}][middlename] - - - true - ${admin_customer_address_postcode} - = - true - address[${admin_customer_address_entity_id}][postcode] - - - true - - = - true - address[${admin_customer_address_entity_id}][prefix] - - - true - ${admin_customer_address_region} - = - true - address[${admin_customer_address_entity_id}][region] - - - true - ${admin_customer_address_region_id} - = - true - address[${admin_customer_address_entity_id}][region_id] - - - true - ${admin_customer_address_street} - = - true - address[${admin_customer_address_entity_id}][street][0] - - - true - - = - true - address[${admin_customer_address_entity_id}][street][1] - - - true - - = - true - address[${admin_customer_address_entity_id}][suffix] - - - true - ${admin_customer_address_telephone} - = - true - address[${admin_customer_address_entity_id}][telephone] - - - true - - = - true - address[${admin_customer_address_entity_id}][vat_id] - - - true - ${admin_customer_address_customer_id} - = - true - address[${admin_customer_address_entity_id}][customer_id] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_billing] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_shipping] - - - true - - = - true - address[new_0][prefix] - - - true - John - = - true - address[new_0][firstname] - - - true - - = - true - address[new_0][middlename] - - - true - Doe - = - true - address[new_0][lastname] - - - true - - = - true - address[new_0][suffix] - - - true - Test Company - = - true - address[new_0][company] - - - true - Folsom - = - true - address[new_0][city] - - - true - 95630 - = - true - address[new_0][postcode] - - - true - 1234567890 - = - true - address[new_0][telephone] - - - true - - = - true - address[new_0][vat_id] - - - true - false - = - true - address[new_0][default_billing] - - - true - false - = - true - address[new_0][default_shipping] - - - true - 123 Main - = - true - address[new_0][street][0] - - - true - - = - true - address[new_0][street][1] - - - true - - = - true - address[new_0][region] - - - true - US - = - true - address[new_0][country_id] - - - true - ${admin_customer_address_region_id} - = - true - address[new_0][region_id] - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index/validate/ - POST - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 16 - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_customer_entity_id} - = - true - customer[entity_id] - - - true - ${admin_customer_website_id} - = - true - customer[website_id] - - - true - ${admin_customer_email} - = - true - customer[email] - - - true - ${admin_customer_group_id} - = - true - customer[group_id] - - - true - ${admin_customer_store_id} - = - true - customer[store_id] - - - true - ${admin_customer_created_at} - = - true - customer[created_at] - - - true - ${admin_customer_updated_at} - = - true - customer[updated_at] - - - true - ${admin_customer_is_active} - = - true - customer[is_active] - - - true - ${admin_customer_disable_auto_group_change} - = - true - customer[disable_auto_group_change] - - - true - ${admin_customer_created_in} - = - true - customer[created_in] - - - true - - = - true - customer[prefix] - - - true - ${admin_customer_firstname} 1 - = - true - customer[firstname] - - - true - - = - true - customer[middlename] - - - true - ${admin_customer_lastname} 1 - = - true - customer[lastname] - - - true - - = - true - customer[suffix] - - - true - ${admin_customer_dob} - = - true - customer[dob] - - - true - ${admin_customer_default_billing} - = - true - customer[default_billing] - - - true - ${admin_customer_default_shipping} - = - true - customer[default_shipping] - - - true - - = - true - customer[taxvat] - - - true - ${admin_customer_gender} - = - true - customer[gender] - - - true - ${admin_customer_failures_num} - = - true - customer[failures_num] - - - true - ${admin_customer_store_id} - = - true - customer[sendemail_store_id] - - - true - ${admin_customer_address_entity_id} - = - true - address[${admin_customer_address_entity_id}][entity_id] - - - - true - ${admin_customer_address_created_at} - = - true - address[${admin_customer_address_entity_id}][created_at] - - - true - ${admin_customer_address_updated_at} - = - true - address[${admin_customer_address_entity_id}][updated_at] - - - true - ${admin_customer_address_is_active} - = - true - address[${admin_customer_address_entity_id}][is_active] - - - true - ${admin_customer_address_city} - = - true - address[${admin_customer_address_entity_id}][city] - - - true - - = - true - address[${admin_customer_address_entity_id}][company] - - - true - ${admin_customer_address_country_id} - = - true - address[${admin_customer_address_entity_id}][country_id] - - - true - ${admin_customer_address_firstname} - = - true - address[${admin_customer_address_entity_id}][firstname] - - - true - ${admin_customer_address_lastname} - = - true - address[${admin_customer_address_entity_id}][lastname] - - - true - - = - true - address[${admin_customer_address_entity_id}][middlename] - - - true - ${admin_customer_address_postcode} - = - true - address[${admin_customer_address_entity_id}][postcode] - - - true - - = - true - address[${admin_customer_address_entity_id}][prefix] - - - true - ${admin_customer_address_region} - = - true - address[${admin_customer_address_entity_id}][region] - - - true - ${admin_customer_address_region_id} - = - true - address[${admin_customer_address_entity_id}][region_id] - - - true - ${admin_customer_address_street} - = - true - address[${admin_customer_address_entity_id}][street][0] - - - true - - = - true - address[${admin_customer_address_entity_id}][street][1] - - - true - - = - true - address[${admin_customer_address_entity_id}][suffix] - - - true - ${admin_customer_address_telephone} - = - true - address[${admin_customer_address_entity_id}][telephone] - - - true - - = - true - address[${admin_customer_address_entity_id}][vat_id] - - - true - ${admin_customer_address_customer_id} - = - true - address[${admin_customer_address_entity_id}][customer_id] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_billing] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_shipping] - - - true - - = - true - address[new_0][prefix] - - - true - John - = - true - address[new_0][firstname] - - - true - - = - true - address[new_0][middlename] - - - true - Doe - = - true - address[new_0][lastname] - - - true - - = - true - address[new_0][suffix] - - - true - Test Company - = - true - address[new_0][company] - - - true - Folsom - = - true - address[new_0][city] - - - true - 95630 - = - true - address[new_0][postcode] - - - true - 1234567890 - = - true - address[new_0][telephone] - - - true - - = - true - address[new_0][vat_id] - - - true - false - = - true - address[new_0][default_billing] - - - true - false - = - true - address[new_0][default_shipping] - - - true - 123 Main - = - true - address[new_0][street][0] - - - true - - = - true - address[new_0][street][1] - - - true - - = - true - address[new_0][region] - - - true - US - = - true - address[new_0][country_id] - - - true - 12 - = - true - address[new_0][region_id] - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index/save/ - POST - true - false - true - true - false - - - - - - You saved the customer. - - Assertion.response_data - false - 2 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCustomerManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminEditOrderPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[GraphQL C] Admin Edit Order"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/orders_page.jmx - - - - Create New Order - - Assertion.response_data - false - 2 - - - - - - - - - true - sales_order_grid - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 200 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - increment_id - = - true - sorting[field] - - - true - desc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - false - - - true - pending - = - true - filters[status] - true - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - sales_order_grid - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - 200 - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - increment_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - true - pending - = - true - filters[status] - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/search_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - false - order_numbers - \"increment_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - false - order_ids - \"entity_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - - - tool/fragments/ce/admin_create_process_returns/setup.jmx - - import java.util.ArrayList; - import java.util.HashMap; - import org.apache.jmeter.protocol.http.util.Base64Encoder; - import java.util.Random; - - // get count of "order_numbers" variable defined in "Search Pending Orders Limit" - int ordersCount = Integer.parseInt(vars.get("order_numbers_matchNr")); - - - int clusterLength; - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - //Number of orders for one thread - clusterLength = ordersCount; - } else { - clusterLength = Math.round(ordersCount / threadsNumber); - if (clusterLength == 0) { - clusterLength = 1; - } - } - - //Current thread number starts from 0 - int currentThreadNum = ctx.getThreadNum(); - - //Index of the current product from the cluster - Random random = new Random(); - if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - int iterator = random.nextInt(clusterLength); - if (iterator == 0) { - iterator = 1; - } - - int i = clusterLength * currentThreadNum + iterator; - - orderNumber = vars.get("order_numbers_" + i.toString()); - orderId = vars.get("order_ids_" + i.toString()); - vars.put("order_number", orderNumber); - vars.put("order_id", orderId); - - - - - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/view/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_order.jmx - - - - #${order_number} - - Assertion.response_data - false - 2 - - - - false - order_status - <span id="order_status">([^<]+)</span> - $1$ - - 1 - simple_products - - - - - - "${order_status}" == "Pending" - false - tool/fragments/ce/admin_edit_order/if_controller.jmx - - - - - - true - pending - = - true - history[status] - false - - - true - Some text - = - true - history[comment] - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/addComment/order_id/${order_id}/?isAjax=true - POST - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/add_comment.jmx - - - - Not Notified - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_start.jmx - - - - Invoice Totals - - Assertion.response_data - false - 2 - - - - false - item_ids - <div id="order_item_(\d+)_title"\s*class="product-title"> - $1$ - - -1 - simple_products - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - invoice[items][${item_ids_1}] - - - true - 1 - = - true - invoice[items][${item_ids_2}] - - - true - Invoiced - = - true - invoice[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx - - - - The invoice has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/shipment_start.jmx - - - - New Shipment - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - shipment[items][${item_ids_1}] - - - true - 1 - = - true - shipment[items][${item_ids_2}] - - - true - Shipped - = - true - shipment[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/shipment_submit.jmx - - - - The shipment has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - - - continue - - false - ${loops} - - ${restAPIcombinedBenchmarkPoolUsers} - ${ramp_period} - 1505803944000 - 1505803944000 - false - - - tool/fragments/_system/thread_group.jmx - - - javascript - - - - var cacheHitPercent = vars.get("cache_hits_percentage"); - -if ( - cacheHitPercent < 100 && - sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' -) { - doCache(); -} - -function doCache(){ - var random = Math.random() * 100; - if (cacheHitPercent < random) { - sampler.setPath(sampler.getPath() + "?cacheModifier=" + Math.random().toString(36).substring(2, 13)); - } -} - - tool/fragments/ce/common/cache_hit_miss.jmx - - - - 1 - false - 1 - ${cBrowseCatalogByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Catalog Browsing By Guest"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - - - - true - identifier - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - home - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/cmsPage/search - GET - true - false - true - false - false - - tool/fragments/ce/api/get_home_page.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - 1 - = - true - searchCriteria[page_size] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/categories - GET - true - false - true - false - false - - tool/fragments/ce/api/get_list_of_categories.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - category_id - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - ${category_id} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - true - 12 - = - true - searchCriteria[page_size] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_list_of_products_by_category_id.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_configurable_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - - - 1 - false - 1 - ${cSiteSearchPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Site Search"); - - true - - - - - ${files_folder}search_terms.csv - UTF-8 - - , - false - true - false - shareMode.thread - tool/fragments/ce/search/search_terms.jmx - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - 1 - false - 1 - ${searchQuickPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Quick Search"); - - true - - - - - - - - true - identifier - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - home - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/cmsPage/search - GET - true - false - true - false - false - - tool/fragments/ce/api/get_home_page.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - quick_search_container - = - true - searchCriteria[request_name] - - - true - search_term - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - ${searchTerm} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - 20 - = - true - searchCriteria[page_size] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/search - GET - true - false - true - false - false - - tool/fragments/ce/api/search_quick.jmx - - - - api_search_products_query_total_count - $.total_count - - - BODY - - - - String totalCount=vars.get("api_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - false - product_ids - "id":([^',]+) - $1$ - - -1 - - - - attribute_code_1 - $.aggregations.buckets[1].name - - - BODY - - - - attribute_value_1 - $.aggregations.buckets[1].values[0].value - - - BODY - - - - attribute_code_2 - $.aggregations.buckets[2].name - - - BODY - - - - attribute_value_2 - $.aggregations.buckets[2].values[0].value - - - BODY - - - - - - -foundProducts = Integer.parseInt(vars.get("product_ids_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items_by_id.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup_by_id.jmx - -number = vars.get("_counter"); -product = vars.get("product_ids_"+number); - -vars.put("product_id", product); - - - - true - - - - - - - - false - entity_id - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_id} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_simple_product_details_by_product_id.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - - - 1 - false - 1 - ${searchQuickFilterPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Quick Search With Filtration"); - - true - - - - - - - - true - identifier - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - home - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/cmsPage/search - GET - true - false - true - false - false - - tool/fragments/ce/api/get_home_page.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - quick_search_container - = - true - searchCriteria[request_name] - - - true - search_term - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - ${searchTerm} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - 20 - = - true - searchCriteria[page_size] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/search - GET - true - false - true - false - false - - tool/fragments/ce/api/search_quick.jmx - - - - api_search_products_query_total_count - $.total_count - - - BODY - - - - String totalCount=vars.get("api_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - false - product_ids - "id":([^',]+) - $1$ - - -1 - - - - attribute_code_1 - $.aggregations.buckets[1].name - - - BODY - - - - attribute_value_1 - $.aggregations.buckets[1].values[0].value - - - BODY - - - - attribute_code_2 - $.aggregations.buckets[2].name - - - BODY - - - - attribute_value_2 - $.aggregations.buckets[2].values[0].value - - - BODY - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/api/searched_attributes_setup.jmx - -number = vars.get("_counter"); -attribute_code = vars.get("attribute_code_"+number); - -attribute_code = attribute_code.replace("_bucket", ""); - -vars.put("attribute_code", attribute_code); - -attribute_value = vars.get("attribute_value_"+number); - -vars.put("attribute_value", attribute_value); - - - - true - - - - - - - - true - quick_search_container - = - true - searchCriteria[request_name] - - - true - search_term - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - ${searchTerm} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - ${attribute_code} - = - true - searchCriteria[filter_groups][1][filters][0][field] - - - true - ${attribute_value} - = - true - searchCriteria[filter_groups][1][filters][0][value] - - - true - 20 - = - true - searchCriteria[page_size] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/search - GET - true - false - true - false - false - - tool/fragments/ce/api/search_quick_filter_attribute.jmx - - - - api_search_products_query_total_count - $.total_count - - - BODY - - - - String totalCount=vars.get("api_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - false - product_ids - "id":([^',]+) - $1$ - - -1 - - - - - - - -foundProducts = Integer.parseInt(vars.get("product_ids_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items_by_id.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup_by_id.jmx - -number = vars.get("_counter"); -product = vars.get("product_ids_"+number); - -vars.put("product_id", product); - - - - true - - - - - - - - false - entity_id - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_id} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_simple_product_details_by_product_id.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - - - 1 - false - 1 - ${searchAdvancedPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Advanced Search"); - - true - - - - - - - - true - identifier - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - home - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/cmsPage/search - GET - true - false - true - false - false - - tool/fragments/ce/api/get_home_page.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - quick_search_container - = - true - searchCriteria[request_name] - - - true - search_term - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - ${searchTerm} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - price.to - = - true - searchCriteria[filter_groups][1][filters][0][field] - - - true - ${priceTo} - = - true - searchCriteria[filter_groups][1][filters][0][value] - - - true - 20 - = - true - searchCriteria[page_size] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/search - GET - true - false - true - false - false - - tool/fragments/ce/api/search_advanced.jmx - - - - api_search_products_query_total_count - $.total_count - - - BODY - - - - String totalCount=vars.get("api_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - false - product_ids - "id":([^',]+) - $1$ - - -1 - - - - - - -foundProducts = Integer.parseInt(vars.get("product_ids_matchNr")); - -if (foundProducts > 3) { - foundProducts = 3; -} - -vars.put("foundProducts", String.valueOf(foundProducts)); - - - - true - tool/fragments/ce/search/set_found_items_by_id.jmx - - - - true - ${foundProducts} - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - tool/fragments/ce/search/searched_products_setup_by_id.jmx - -number = vars.get("_counter"); -product = vars.get("product_ids_"+number); - -vars.put("product_id", product); - - - - true - - - - - - - - false - entity_id - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_id} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_simple_product_details_by_product_id.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - - - - - 1 - false - 1 - ${cAddToCartByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Add To Cart By Guest"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/ - POST - true - false - true - false - false - - tool/fragments/ce/api/create_guest_cart.jmx - - - cart_id - $ - - - BODY - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - - - - - - true - identifier - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - home - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/cmsPage/search - GET - true - false - true - false - false - - tool/fragments/ce/api/get_home_page.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - 1 - = - true - searchCriteria[page_size] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/categories - GET - true - false - true - false - false - - tool/fragments/ce/api/get_list_of_categories.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - category_id - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - ${category_id} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - true - 12 - = - true - searchCriteria[page_size] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_list_of_products_by_category_id.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - true - - - - false - { - "cartItem": { - "sku": "${product_sku}", - "qty":"1", - "quote_id":"${cart_id}" - } -} - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/items - POST - true - false - true - false - false - - tool/fragments/ce/api/guest_checkout/add_simple_product_to_cart.jmx - - - - $.quote_id - ^[a-z0-9-]+$ - true - false - false - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_configurable_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/configurable-products/${product_sku}/children - GET - true - false - true - false - false - - tool/fragments/ce/api/get_configurable_product_options_by_product_sku.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $[0].sku - - false - false - false - false - - - - - product_option - $[0].sku - - - BODY - tool/fragments/ce/api/extract_configurable_product_option_from_product_detail.jmx - - - - - true - - - - false - { - "cartItem": { - "sku": "${product_option}", - "qty":"1", - "quote_id":"${cart_id}" - } -} - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/items - POST - true - false - true - false - false - - tool/fragments/ce/api/guest_checkout/add_configurable_product_to_cart.jmx - - - - $.quote_id - ^[a-z0-9-]+$ - true - false - false - - - - - - - - - 1 - false - 1 - ${cAddToWishlistPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Add to Wishlist"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - 5 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - - - 1 - false - 1 - ${cCompareProductsPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Compare Products"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - - - - true - identifier - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - home - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/cmsPage/search - GET - true - false - true - false - false - - tool/fragments/ce/api/get_home_page.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - 1 - = - true - searchCriteria[page_size] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/categories - GET - true - false - true - false - false - - tool/fragments/ce/api/get_list_of_categories.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - category_id - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - ${category_id} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - true - 12 - = - true - searchCriteria[page_size] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_list_of_products_by_category_id.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_configurable_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - - - 1 - false - 1 - ${cCheckoutByGuestPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Checkout By Guest"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - true - - - - false - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/ - POST - true - false - true - false - false - - tool/fragments/ce/api/create_guest_cart.jmx - - - cart_id - $ - - - BODY - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - - - - - - true - identifier - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - home - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/cmsPage/search - GET - true - false - true - false - false - - tool/fragments/ce/api/get_home_page.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - 1 - = - true - searchCriteria[page_size] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/categories - GET - true - false - true - false - false - - tool/fragments/ce/api/get_list_of_categories.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - category_id - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - ${category_id} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - true - 12 - = - true - searchCriteria[page_size] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_list_of_products_by_category_id.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - true - - - - false - { - "cartItem": { - "sku": "${product_sku}", - "qty":"1", - "quote_id":"${cart_id}" - } -} - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/items - POST - true - false - true - false - false - - tool/fragments/ce/api/guest_checkout/add_simple_product_to_cart.jmx - - - - $.quote_id - ^[a-z0-9-]+$ - true - false - false - - - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_configurable_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/configurable-products/${product_sku}/children - GET - true - false - true - false - false - - tool/fragments/ce/api/get_configurable_product_options_by_product_sku.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $[0].sku - - false - false - false - false - - - - - product_option - $[0].sku - - - BODY - tool/fragments/ce/api/extract_configurable_product_option_from_product_detail.jmx - - - - - true - - - - false - { - "cartItem": { - "sku": "${product_option}", - "qty":"1", - "quote_id":"${cart_id}" - } -} - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/items - POST - true - false - true - false - false - - tool/fragments/ce/api/guest_checkout/add_configurable_product_to_cart.jmx - - - - $.quote_id - ^[a-z0-9-]+$ - true - false - false - - - - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.jmx - - - - true - - - - false - {"address":{"country_id":"US","postcode":"95630"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/estimate-shipping-methods - POST - true - false - true - false - false - - tool/fragments/ce/api/guest_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx - - - - - "available":true - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"addressInformation":{"shipping_address":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"},"shipping_method_code":"flatrate","shipping_carrier_code":"flatrate"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/shipping-information - POST - true - false - true - false - false - - tool/fragments/ce/api/guest_checkout/checkout_billing_shipping_information.jmx - - - - - {"payment_methods": - - Assertion.response_data - false - 2 - - - - - - true - - - - false - {"cartId":"${cart_id}","email":"test@example.com","paymentMethod":{"method":"checkmo","po_number":null,"additional_data":null},"billingAddress":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname","save_in_address_book":0}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/payment-information - POST - true - false - true - false - false - - tool/fragments/ce/api/guest_checkout/checkout_payment_info_place_order.jmx - - - - - "[0-9]+" - - Assertion.response_data - false - 2 - - - - order_id - $ - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - - - - 1 - false - 1 - ${cCheckoutByCustomerPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Checkout By Customer"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - javascript - - - - random = vars.getObject("randomIntGenerator"); - -var categories = props.get("categories"); -number = random.nextInt(categories.length); - -vars.put("category_url_key", categories[number].url_key); -vars.put("category_name", categories[number].name); -vars.put("category_id", categories[number].id); -vars.putObject("category", categories[number]); - - tool/fragments/ce/common/extract_category_setup.jmx - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - true - - - - false - { - "username": "${customer_email}", - "password": "${customer_password}" -} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/integration/customer/token - POST - true - false - true - false - false - - tool/fragments/ce/api/login.jmx - - - - customer_token - $ - - - BODY - - - - $ - - false - false - false - false - - - - - - true - - - - false - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine - POST - true - false - true - false - false - - tool/fragments/ce/api/create_customer_cart.jmx - - - - cart_id - $ - - - BODY - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/graphql/set_customer_token.jmx - - - - - - - - - true - identifier - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - home - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/cmsPage/search - GET - true - false - true - false - false - - tool/fragments/ce/api/get_home_page.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - 1 - = - true - searchCriteria[page_size] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/categories - GET - true - false - true - false - false - - tool/fragments/ce/api/get_list_of_categories.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - - - - true - category_id - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - true - ${category_id} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - true - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - true - 12 - = - true - searchCriteria[page_size] - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_list_of_products_by_category_id.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - - - true - 2 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/simple_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_simple_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - true - - - - false - { - "cartItem": { - "sku": "${product_sku}", - "qty":"1", - "quote_id":"${cart_id}" - } -} - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/items - POST - true - false - true - false - false - - tool/fragments/ce/api/customer_checkout/add_simple_product_to_cart.jmx - - - - $.quote_id - ^[a-z0-9-]+$ - true - false - false - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/api/set_customer_token.jmx - - - - - true - 1 - tool/fragments/ce/loop_controller.jmx - - - 1 - - 1 - _counter - - true - true - - - - - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("configurable_products_list").get(number); - -vars.put("product_url_key", product.get("url_key")); -vars.put("product_id", product.get("id")); -vars.put("product_name", product.get("title")); -vars.put("product_uenc", product.get("uenc")); -vars.put("product_sku", product.get("sku")); - - - - true - tool/fragments/ce/product_browsing_and_adding_items_to_the_cart/configurable_products_setup.jmx - - - - - - - false - url_key - = - true - searchCriteria[filter_groups][0][filters][0][field] - - - false - ${product_url_key} - = - true - searchCriteria[filter_groups][0][filters][0][value] - - - false - eq - = - true - searchCriteria[filter_groups][0][filters][0][condition_type] - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/products - GET - true - false - true - false - false - - tool/fragments/ce/api/get_configurable_product_details_by_product_url_key.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $.items[0].sku - - false - false - false - false - - - - - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/configurable-products/${product_sku}/children - GET - true - false - true - false - false - - tool/fragments/ce/api/get_configurable_product_options_by_product_sku.jmx - - - - - errors - - Assertion.response_data - false - 6 - variable - - - - - $[0].sku - - false - false - false - false - - - - - product_option - $[0].sku - - - BODY - tool/fragments/ce/api/extract_configurable_product_option_from_product_detail.jmx - - - - - true - - - - false - { - "cartItem": { - "sku": "${product_option}", - "qty":"1", - "quote_id":"${cart_id}" - } -} - - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/items - POST - true - false - true - false - false - - tool/fragments/ce/api/customer_checkout/add_configurable_product_to_cart.jmx - - - - $.quote_id - ^[a-z0-9-]+$ - true - false - false - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/api/set_customer_token.jmx - - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.jmx - - - - true - - - - false - {"address":{"country_id":"US","postcode":"95630"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/estimate-shipping-methods - POST - true - false - true - false - false - - tool/fragments/ce/api/customer_checkout/checkout_estimate_shipping_methods_with_postal_code.jmx - - - - - "available":true - - Assertion.response_data - false - 2 - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/api/set_customer_token.jmx - - - - true - - - - false - {"addressInformation":{"shipping_address":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"},"shipping_method_code":"flatrate","shipping_carrier_code":"flatrate"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/shipping-information - POST - true - false - true - false - false - - tool/fragments/ce/api/customer_checkout/checkout_billing_shipping_information.jmx - - - - - {"payment_methods": - - Assertion.response_data - false - 2 - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/api/set_customer_token.jmx - - - - true - - - - false - {"cartId":"${cart_id}","email":"test@example.com","paymentMethod":{"method":"checkmo","po_number":null,"additional_data":null},"billingAddress":{"countryId":"US","regionId":"${california_region_id}","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname","save_in_address_book":0}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/payment-information - POST - true - false - true - false - false - - tool/fragments/ce/api/customer_checkout/checkout_payment_info_place_order.jmx - - - - - "[0-9]+" - - Assertion.response_data - false - 2 - - - - order_id - $ - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - tool/fragments/ce/api/set_customer_token.jmx - - - - return-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/return_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - - - true - - - - - - - - 1 - false - 1 - ${cAccountManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Account management"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - get-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/get_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUser = customerUserList.poll(); -if (customerUser == null) { - SampleResult.setResponseMessage("customerUser list is empty"); - SampleResult.setResponseData("customerUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("customer_email", customerUser); - - - - true - - - - - - - - - true - customer_email - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - true - ${customer_email} - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - true - 20 - = - true - searchCriteria[pageSize] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/orders - GET - true - false - true - false - false - - tool/fragments/ce/api/customer_orders.jmx - - - - order_number - $.items[0].increment_id - NOT_FOUND - - BODY - - - - - - tool/fragments/ce/api/if_orders.jmx - "${order_number}" != "NOT_FOUND" - false - - - - - - - true - increment_id - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - true - ${order_number} - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - true - 20 - = - true - searchCriteria[pageSize] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/orders - GET - true - false - true - false - false - - tool/fragments/ce/api/if_orders.jmx - - - - $.items[0].increment_id - - false - false - false - false - - - - - - - return-email - tool/fragments/ce/lock_controller.jmx - - - - tool/fragments/ce/return_customer_email.jmx - -customerUserList = props.get("customer_emails_list"); -customerUserList.add(vars.get("customer_email")); - - - - true - - - - - - - - 1 - false - 1 - ${cAdminCMSManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin CMS Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_cms_management/admin_cms_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/ - GET - true - false - true - false - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/new - GET - true - false - true - false - false - - - - - - - - true - <p>CMS Content ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - content - - - true - - = - true - content_heading - - - true - ${admin_form_key} - = - true - form_key - - - true - - = - true - identifier - - - true - 1 - = - true - is_active - - - true - - = - true - layout_update_xml - - - true - - = - true - meta_description - - - true - - = - true - meta_keywords - - - true - - = - true - meta_title - - - false - {} - = - true - nodes_data - - - true - - = - true - node_ids - - - true - - = - true - page_id - - - true - 1column - = - true - page_layout - - - true - 0 - = - true - store_id[0] - - - true - CMS Title ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - title - - - true - 0 - = - true - website_root - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/cms/page/save/ - POST - true - false - true - false - false - - - - - - You saved the page. - - Assertion.response_data - false - 16 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCMSManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminBrowseProductGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Browse Product Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Product"); - - pagesCount = parseInt(vars.get("products_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "product_listing"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_product_filter_text")); - vars.put("grid_filter_field", "name"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "name"); - vars.put("grid_sort_field_2", "price"); - vars.put("grid_sort_field_3", "attribute_set_id"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_products_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminBrowseOrderGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Browse Order Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Order"); - - pagesCount = parseInt(vars.get("orders_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "sales_order_grid"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_orders_filter_text")); - vars.put("grid_filter_field", "status"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "increment_id"); - vars.put("grid_sort_field_2", "created_at"); - vars.put("grid_sort_field_3", "billing_name"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_orders_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminProductCreationPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Create Product"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/once_only_controller.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(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom}); -} -relatedIndex = random.nextInt(props.get("simple_products_list").size()); -vars.put("related_product_id", props.get("simple_products_list").get(relatedIndex).get("id")); - - - true - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - - - - false - mycolor - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - false - attribute_code - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - false - mysize - = - true - searchCriteria[filterGroups][0][filters][1][value] - - - false - attribute_code - = - true - searchCriteria[filterGroups][0][filters][1][field] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/attributes - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/get_product_attributes.jmx - - - product_attributes - $.items - - - BODY - - - - javascript - - - - -var attributesData = JSON.parse(vars.get("product_attributes")), -maxOptions = 2; - -attributes = []; -for (i in attributesData) { - if (i >= 2) { - break; - } - var data = attributesData[i], - attribute = { - "id": data.attribute_id, - "code": data.attribute_code, - "label": data.default_frontend_label, - "options": [] - }; - - var processedOptions = 0; - for (optionN in data.options) { - var option = data.options[optionN]; - if (parseInt(option.value) > 0 && processedOptions < maxOptions) { - processedOptions++; - attribute.options.push(option); - } - } - attributes.push(attribute); -} - -vars.putObject("product_attributes", attributes); - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product_set/index/filter/${attribute_set_filter} - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_setup_attribute_set.jmx - - - - false - attribute_set_id - catalog&#x2F;product_set&#x2F;edit&#x2F;id&#x2F;([\d]+)&#x2F;"[\D\d]*Attribute Set 1 - $1$ - - 1 - - - - false - - - import org.apache.commons.codec.binary.Base64; - -byte[] encodedBytes = Base64.encodeBase64("set_name=Attribute Set 1".getBytes()); -vars.put("attribute_set_filter", new String(encodedBytes)); - - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - 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()); - -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")); - -do { - number1 = random.nextInt(props.get("simple_products_list_for_edit").size()); -} while(number == number1); -simpleList = props.get("simple_products_list_for_edit").get(number1); -vars.put("simple_product_2_id", simpleList.get("id")); -vars.put("simple_product_2_name", simpleList.get("title")); - -number2 = random.nextInt(props.get("configurable_products_list").size()); -configurableList = props.get("configurable_products_list").get(number2); -vars.put("configurable_product_1_id", configurableList.get("id")); -vars.put("configurable_product_1_url_key", configurableList.get("url_key")); -vars.put("configurable_product_1_name", configurableList.get("title")); - -//Additional category to be added -//int categoryId = Integer.parseInt(vars.get("simple_product_category_id")); -//vars.put("category_additional", (categoryId+1).toString()); -//New price -vars.put("price_new", "9999"); -//New special price -vars.put("special_price_new", "8888"); -//New quantity -vars.put("quantity_new", "100600"); -vars.put("configurable_sku", "Configurable Product - ${__time(YMD)}-${__threadNum}-${__Random(1,1000000)}"); - - - - - true - tool/fragments/ce/admin_create_product/setup.jmx - - - - tool/fragments/ce/admin_create_product/create_bundle_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/bundle/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 42 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[configurable_variations] - - - true - 1 - = - true - affect_configurable_product_attributes - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - new-variations-attribute-set-id - - - true - 0 - = - true - product[shipment_type] - - - true - option title one - = - true - bundle_options[bundle_options][0][title] - - - true - - = - true - bundle_options[bundle_options][0][option_id] - - - true - - = - true - bundle_options[bundle_options][0][delete] - - - true - select - = - true - bundle_options[bundle_options][0][type] - - - true - 1 - = - true - bundle_options[bundle_options][0][required] - - - true - 0 - = - true - bundle_options[bundle_options][0][position] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][option_id] - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][0][bundle_selections][0][product_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][delete] - - - true - 25 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_value] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_type] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty] - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][0][position] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][option_id] - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][0][bundle_selections][1][product_id] - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][delete] - - - true - 10.99 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_value] - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_type] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty] - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][position] - - - true - option title two - = - true - bundle_options[bundle_options][1][title] - - - true - - = - true - bundle_options[bundle_options][1][option_id] - - - true - - = - true - bundle_options[bundle_options][1][delete] - - - true - select - = - true - bundle_options[bundle_options][1][type] - - - true - 1 - = - true - bundle_options[bundle_options][1][required] - - - true - 1 - = - true - bundle_options[bundle_options][1][position] - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][option_id] - true - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][1][bundle_selections][0][product_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][delete] - true - - - true - 5.00 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_value] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_type] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][position] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][option_id] - true - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][1][bundle_selections][1][product_id] - true - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][delete] - true - - - true - 7.00 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_value] - true - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_type] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty] - true - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][position] - true - - - true - 2 - = - true - affect_bundle_product_selections - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 42 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full bundle product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short bundle product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[configurable_variations] - - - true - 1 - = - true - affect_configurable_product_attributes - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - bundle-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Bundle Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - new-variations-attribute-set-id - - - true - 0 - = - true - product[shipment_type] - false - - - true - option title one - = - true - bundle_options[bundle_options][0][title] - false - - - true - - = - true - bundle_options[bundle_options][0][option_id] - false - - - true - - = - true - bundle_options[bundle_options][0][delete] - false - - - true - select - = - true - bundle_options[bundle_options][0][type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][required] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][position] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][option_id] - false - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][0][bundle_selections][0][product_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][0][delete] - false - - - true - 25 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_value] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][0][selection_can_change_qty] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][0][position] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][option_id] - false - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][0][bundle_selections][1][product_id] - false - - - true - - = - true - bundle_options[bundle_options][0][bundle_selections][1][delete] - false - - - true - 10.99 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][selection_can_change_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][0][bundle_selections][1][position] - false - - - true - option title two - = - true - bundle_options[bundle_options][1][title] - false - - - true - - = - true - bundle_options[bundle_options][1][option_id] - false - - - true - - = - true - bundle_options[bundle_options][1][delete] - false - - - true - select - = - true - bundle_options[bundle_options][1][type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][required] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][position] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][option_id] - false - - - true - ${simple_product_1_id} - = - true - bundle_options[bundle_options][1][bundle_selections][0][product_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][0][delete] - false - - - true - 5.00 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][0][selection_can_change_qty] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][0][position] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][option_id] - false - - - true - ${simple_product_2_id} - = - true - bundle_options[bundle_options][1][bundle_selections][1][product_id] - false - - - true - - = - true - bundle_options[bundle_options][1][bundle_selections][1][delete] - false - - - true - 7.00 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_value] - false - - - true - 0 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_price_type] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][selection_can_change_qty] - false - - - true - 1 - = - true - bundle_options[bundle_options][1][bundle_selections][1][position] - false - - - true - 2 - = - true - affect_bundle_product_selections - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/bundle/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - option title one - option title two - ${simple_product_2_name} - ${simple_product_1_name} - - - Assertion.response_data - false - 2 - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/open_catalog_grid.jmx - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/${attribute_set_id}/type/configurable/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_product/new_configurable.jmx - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - ${admin_form_key} - = - true - form_key - true - - - true - ${attribute_set_id} - = - true - new-variations-attribute-set-id - true - - - true - 1 - = - true - product[affect_product_custom_options] - true - - - true - ${attribute_set_id} - = - true - product[attribute_set_id] - true - - - true - 4 - = - true - product[category_ids][0] - true - - - true - - = - true - product[custom_layout_update] - true - - - true - - = - true - product[description] - true - - - true - 0 - = - true - product[gift_message_available] - true - - - true - 1 - = - true - product[gift_wrapping_available] - true - - - true - - = - true - product[gift_wrapping_price] - true - - - true - - = - true - product[image] - true - - - true - 2 - = - true - product[is_returnable] - true - - - true - ${configurable_sku} - Meta Description - = - true - product[meta_description] - true - - - true - ${configurable_sku} - Meta Keyword - = - true - product[meta_keyword] - true - - - true - ${configurable_sku} - Meta Title - = - true - product[meta_title] - true - - - true - ${configurable_sku} - = - true - product[name] - true - - - true - container2 - = - true - product[options_container] - true - - - true - ${price_new} - = - true - product[price] - true - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - true - - - true - 1000 - = - true - product[quantity_and_stock_status][qty] - true - - - true - - = - true - product[short_description] - true - - - true - ${configurable_sku} - = - true - product[sku] - true - - - true - - = - true - product[small_image] - true - - - true - ${special_price_new} - = - true - product[special_price] - true - - - true - 1 - = - true - product[status] - true - - - true - 0 - = - true - product[stock_data][backorders] - true - - - true - 1 - = - true - product[stock_data][deferred_stock_update] - true - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - true - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - true - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - true - - - true - 1 - = - true - product[stock_data][manage_stock] - true - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - true - - - true - 0 - = - true - product[stock_data][min_qty] - true - - - true - 1 - = - true - product[stock_data][min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_backorders] - true - - - true - 1 - = - true - product[stock_data][use_config_deferred_stock_update] - true - - - true - 1 - = - true - product[stock_data][use_config_enable_qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - true - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - true - - - true - 2 - = - true - product[tax_class_id] - true - - - true - - = - true - product[thumbnail] - true - - - true - - = - true - product[url_key] - true - - - true - 1 - = - true - product[use_config_gift_message_available] - true - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - true - - - true - 1 - = - true - product[use_config_is_returnable] - true - - - true - 4 - = - true - product[visibility] - true - - - true - 1 - = - true - product[website_ids][1] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/${attribute_set_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_validate.jmx - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - javascript - - - - -attributes = vars.getObject("product_attributes"); - -for (i in attributes) { - var attribute = attributes[i]; - sampler.addArgument("attribute_codes[" + i + "]", attribute.code); - sampler.addArgument("attributes[" + i + "]", attribute.id); - sampler.addArgument("product[" + attribute.code + "]", attribute.options[0].value); - addConfigurableAttributeData(attribute); -} - -addConfigurableMatrix(attributes); - -function addConfigurableAttributeData(attribute) { - var attributeId = attribute.id; - - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attribute.code); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attribute.label); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][position]", 0); - attribute.options.forEach(function (option, index) { - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][include]", index); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][value_index]", option.value); - }); -} - -/** - * Build 4 simple products for Configurable - */ -function addConfigurableMatrix(attributes) { - - var attribute1 = attributes[0], - attribute2 = attributes[1], - productIndex = 1, - products = []; - var variationNames = []; - attribute1.options.forEach(function (option1) { - attribute2.options.forEach(function (option2) { - var productAttributes = {}, - namePart = option1.label + "+" + option2.label, - variationKey = option1.value + "-" + option2.value; - productAttributes[attribute1.code] = option1.value; - productAttributes[attribute2.code] = option2.value; - - variationNames.push(namePart + " - " + vars.get("configurable_sku")); - var product = { - "id": null, - "name": namePart + " - " + vars.get("configurable_sku"), - "sku": namePart + " - " + vars.get("configurable_sku"), - "status": 1, - "price": "100", - "price_currency": "$", - "price_string": "$100", - "weight": "6", - "qty": "50", - "variationKey": variationKey, - "configurable_attribute": JSON.stringify(productAttributes), - "thumbnail_image": "", - "media_gallery": {"images": {}}, - "image": [], - "was_changed": true, - "canEdit": 1, - "newProduct": 1, - "record_id": productIndex - }; - productIndex++; - products.push(product); - }); - }); - - sampler.addArgument("configurable-matrix-serialized", JSON.stringify(products)); - vars.putObject("configurable_variations_assertion", variationNames); -} - - tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - ${admin_form_key} - = - true - form_key - true - - - true - ${attribute_set_id} - = - true - new-variations-attribute-set-id - true - - - true - 1 - = - true - product[affect_product_custom_options] - true - - - true - ${attribute_set_id} - = - true - product[attribute_set_id] - true - - - true - 2 - = - true - product[category_ids][0] - true - - - true - - = - true - product[custom_layout_update] - true - - - true - - = - true - product[description] - true - - - true - 0 - = - true - product[gift_message_available] - true - - - true - 1 - = - true - product[gift_wrapping_available] - true - - - true - - = - true - product[gift_wrapping_price] - true - - - true - - = - true - product[image] - true - - - true - 2 - = - true - product[is_returnable] - true - - - true - ${configurable_sku} - Meta Description - = - true - product[meta_description] - true - - - true - ${configurable_sku} - Meta Keyword - = - true - product[meta_keyword] - true - - - true - ${configurable_sku} - Meta Title - = - true - product[meta_title] - true - - - true - ${configurable_sku} - = - true - product[name] - true - - - true - container2 - = - true - product[options_container] - true - - - true - ${price_new} - = - true - product[price] - true - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - true - - - true - 1000 - = - true - product[quantity_and_stock_status][qty] - true - - - true - - = - true - product[short_description] - true - - - true - ${configurable_sku} - = - true - product[sku] - true - - - true - - = - true - product[small_image] - true - - - true - ${special_price_new} - = - true - product[special_price] - true - - - true - 1 - = - true - product[status] - true - - - true - 0 - = - true - product[stock_data][backorders] - true - - - true - 1 - = - true - product[stock_data][deferred_stock_update] - true - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - true - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - true - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - true - - - true - 1 - = - true - product[stock_data][manage_stock] - true - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - true - - - true - 0 - = - true - product[stock_data][min_qty] - true - - - true - 1 - = - true - product[stock_data][min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_backorders] - true - - - true - 1 - = - true - product[stock_data][use_config_deferred_stock_update] - true - - - true - 1 - = - true - product[stock_data][use_config_enable_qty_increments] - true - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - true - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - true - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - true - - - true - 2 - = - true - product[tax_class_id] - true - - - true - - = - true - product[thumbnail] - true - - - true - - = - true - product[url_key] - true - - - true - 1 - = - true - product[use_config_gift_message_available] - true - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - true - - - true - 1 - = - true - product[use_config_is_returnable] - true - - - true - 4 - = - true - product[visibility] - true - - - true - 1 - = - true - product[website_ids][1] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/${attribute_set_id}/type/configurable/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_product/configurable_save.jmx - - - - You saved the product - - Assertion.response_data - false - 2 - - - - javascript - - - - -var configurableVariations = vars.getObject("configurable_variations_assertion"), -response = SampleResult.getResponseDataAsString(); - -configurableVariations.forEach(function (variation) { - if (response.indexOf(variation) == -1) { - AssertionResult.setFailureMessage("Cannot find variation \"" + variation + "\""); - AssertionResult.setFailure(true); - } -}); - - - - - - javascript - - - - -attributes = vars.getObject("product_attributes"); - -for (i in attributes) { - var attribute = attributes[i]; - sampler.addArgument("attribute_codes[" + i + "]", attribute.code); - sampler.addArgument("attributes[" + i + "]", attribute.id); - sampler.addArgument("product[" + attribute.code + "]", attribute.options[0].value); - addConfigurableAttributeData(attribute); -} - -addConfigurableMatrix(attributes); - -function addConfigurableAttributeData(attribute) { - var attributeId = attribute.id; - - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attribute.code); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attribute.label); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][position]", 0); - attribute.options.forEach(function (option, index) { - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][include]", index); - sampler.addArgument("product[configurable_attributes_data][" + attributeId + "][values][" + option.value + "][value_index]", option.value); - }); -} - -/** - * Build 4 simple products for Configurable - */ -function addConfigurableMatrix(attributes) { - - var attribute1 = attributes[0], - attribute2 = attributes[1], - productIndex = 1, - products = []; - var variationNames = []; - attribute1.options.forEach(function (option1) { - attribute2.options.forEach(function (option2) { - var productAttributes = {}, - namePart = option1.label + "+" + option2.label, - variationKey = option1.value + "-" + option2.value; - productAttributes[attribute1.code] = option1.value; - productAttributes[attribute2.code] = option2.value; - - variationNames.push(namePart + " - " + vars.get("configurable_sku")); - var product = { - "id": null, - "name": namePart + " - " + vars.get("configurable_sku"), - "sku": namePart + " - " + vars.get("configurable_sku"), - "status": 1, - "price": "100", - "price_currency": "$", - "price_string": "$100", - "weight": "6", - "qty": "50", - "variationKey": variationKey, - "configurable_attribute": JSON.stringify(productAttributes), - "thumbnail_image": "", - "media_gallery": {"images": {}}, - "image": [], - "was_changed": true, - "canEdit": 1, - "newProduct": 1, - "record_id": productIndex - }; - productIndex++; - products.push(product); - }); - }); - - sampler.addArgument("configurable-matrix-serialized", JSON.stringify(products)); - vars.putObject("configurable_variations_assertion", variationNames); -} - - tool/fragments/ce/admin_create_product/configurable_prepare_data.jmx - - - - - - tool/fragments/ce/admin_create_product/create_downloadable_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/downloadable/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - ${files_folder}downloadable_original.txt - links - text/plain - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/downloadable_file/upload/type/links/?isAjax=true - POST - false - false - true - true - false - - - - - original_file - $.file - - - BODY - - - - - - - - ${files_folder}downloadable_sample.txt - samples - text/plain - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/downloadable_file/upload/type/samples/?isAjax=true - POST - false - false - true - true - false - - - - - sample_file - $.file - - - BODY - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - on - = - true - is_downloadable - - - true - Links - = - true - product[links_title] - - - true - 0 - = - true - product[links_purchased_separately] - - - true - ${original_file} - = - true - downloadable[link][0][file][0][file] - false - - - true - downloadable_original.txt - = - true - downloadable[link][0][file][0][name] - false - - - true - 13 - = - true - downloadable[link][0][file][0][size] - false - - - true - new - = - true - downloadable[link][0][file][0][status] - false - - - true - 1 - = - true - downloadable[link][0][is_shareable] - - - true - 0 - = - true - downloadable[link][0][is_unlimited] - - - true - - = - true - downloadable[link][0][link_url] - - - true - 0 - = - true - downloadable[link][0][number_of_downloads] - true - - - true - 120 - = - true - downloadable[link][0][price] - true - - - true - 0 - = - true - downloadable[link][0][record_id] - true - - - true - file - = - true - downloadable[link][0][sample][type] - - - true - - = - true - downloadable[link][0][sample][url] - - - true - 1 - = - true - downloadable[link][0][sort_order] - - - true - Original Link - = - true - downloadable[link][0][title] - - - true - file - = - true - downloadable[link][0][type] - - - true - ${sample_file} - = - true - downloadable[sample][0][file][0][file] - true - - - true - downloadable_sample.txt - = - true - downloadable[sample][0][file][0][name] - true - - - true - 14 - = - true - downloadable[sample][0][file][0][size] - true - - - true - new - = - true - downloadable[sample][0][file][0][status] - true - - - true - 0 - = - true - downloadable[sample][0][record_id] - true - - - true - - = - true - downloadable[sample][0][sample_url] - true - - - true - 1 - = - true - downloadable[sample][0][sort_order] - true - - - true - Sample Link - = - true - downloadable[sample][0][title] - true - - - true - file - = - true - downloadable[sample][0][type] - true - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - 4 - = - true - new-variations-attribute-set-id - false - - - true - - = - true - product[configurable_variation] - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/type/downloadable/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short downloadable product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - false - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - downloadable-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Downloadable Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - ${original_file} - = - true - downloadable[link][0][file][0][file] - false - - - true - downloadable_original.txt - = - true - downloadable[link][0][file][0][name] - false - - - true - 13 - = - true - downloadable[link][0][file][0][size] - false - - - true - new - = - true - downloadable[link][0][file][0][status] - false - - - true - 1 - = - true - downloadable[link][0][is_shareable] - true - - - true - 0 - = - true - downloadable[link][0][is_unlimited] - true - - - true - - = - true - downloadable[link][0][link_url] - true - - - true - 0 - = - true - downloadable[link][0][number_of_downloads] - false - - - true - 120 - = - true - downloadable[link][0][price] - false - - - true - 0 - = - true - downloadable[link][0][record_id] - false - - - true - file - = - true - downloadable[link][0][sample][type] - true - - - true - - = - true - downloadable[link][0][sample][url] - true - - - true - 1 - = - true - downloadable[link][0][sort_order] - true - - - true - Original Link - = - true - downloadable[link][0][title] - true - - - true - file - = - true - downloadable[link][0][type] - true - - - true - ${sample_file} - = - true - downloadable[sample][0][file][0][file] - true - - - true - downloadable_sample.txt - = - true - downloadable[sample][0][file][0][name] - true - - - true - 14 - = - true - downloadable[sample][0][file][0][size] - true - - - true - new - = - true - downloadable[sample][0][file][0][status] - true - - - true - 0 - = - true - downloadable[sample][0][record_id] - true - - - true - - = - true - downloadable[sample][0][sample_url] - true - - - true - 1 - = - true - downloadable[sample][0][sort_order] - true - - - true - Sample Link - = - true - downloadable[sample][0][title] - true - - - true - file - = - true - downloadable[sample][0][type] - true - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - 4 - = - true - new-variations-attribute-set-id - false - - - true - - = - true - product[configurable_variation] - false - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/downloadable/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - violation - - Assertion.response_data - false - 6 - - - - - - - tool/fragments/ce/admin_create_product/create_simple_product.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/ - GET - true - false - true - false - false - - - - - - records found - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/new/set/4/type/simple/ - GET - true - false - true - false - false - - - - - - New Product - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - product[options][1][is_delete] - false - - - true - 1 - = - true - product[options][1][is_require] - false - - - true - select - = - true - product[options][1][previous_group] - false - - - true - drop_down - = - true - product[options][1][previous_type] - false - - - true - 0 - = - true - product[options][1][sort_order] - false - - - true - Product Option Title One - = - true - product[options][1][title] - false - - - true - drop_down - = - true - product[options][1][type] - false - - - true - - = - true - product[options][1][values][1][is_delete] - false - - - true - 200 - = - true - product[options][1][values][1][price] - false - - - true - fixed - = - true - product[options][1][values][1][price_type] - false - - - true - sku-one - = - true - product[options][1][values][1][sku] - false - - - true - 0 - = - true - product[options][1][values][1][sort_order] - false - - - true - Row Title - = - true - product[options][1][values][1][title] - false - - - true - - = - true - product[options][2][is_delete] - false - - - true - 1 - = - true - product[options][2][is_require] - false - - - true - 250 - = - true - product[options][2][max_characters] - false - - - true - text - = - true - product[options][2][previous_group] - false - - - true - field - = - true - product[options][2][previous_type] - false - - - true - 500 - = - true - product[options][2][price] - false - - - true - fixed - = - true - product[options][2][price_type] - false - - - true - sku-two - = - true - product[options][2][sku] - false - - - true - 1 - = - true - product[options][2][sort_order] - false - - - true - Field Title - = - true - product[options][2][title] - false - - - true - field - = - true - product[options][2][type] - false - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - 4 - = - true - new-variations-attribute-set-id - true - - - true - - = - true - product[configurable_variation] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/set/4/ - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[name] - false - - - true - SKU ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[sku] - false - - - true - 123 - = - true - product[price] - - - true - 2 - = - true - product[tax_class_id] - - - true - 111 - = - true - product[quantity_and_stock_status][qty] - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - - - true - 1.0000 - = - true - product[weight] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 2 - = - true - product[category_ids][] - - - true - <p>Full simple product Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[description] - - - true - <p>Short simple product description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}</p> - = - true - product[short_description] - - - true - 1 - = - true - product[status] - - - true - - = - true - product[image] - - - true - - = - true - product[small_image] - - - true - - = - true - product[thumbnail] - - - true - simple-product-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - product[url_key] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Title - = - true - product[meta_title] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Keyword - = - true - product[meta_keyword] - - - true - Simple Product ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} Meta Description - = - true - product[meta_description] - - - true - 1 - = - true - product[website_ids][] - - - true - 99 - = - true - product[special_price] - - - true - - = - true - product[special_from_date] - - - true - - = - true - product[special_to_date] - - - true - - = - true - product[cost] - - - true - 0 - = - true - product[tier_price][0][website_id] - - - true - 32000 - = - true - product[tier_price][0][cust_group] - - - true - 100 - = - true - product[tier_price][0][price_qty] - - - true - 90 - = - true - product[tier_price][0][price] - - - true - - = - true - product[tier_price][0][delete] - - - true - 0 - = - true - product[tier_price][1][website_id] - - - true - 1 - = - true - product[tier_price][1][cust_group] - - - true - 101 - = - true - product[tier_price][1][price_qty] - - - true - 99 - = - true - product[tier_price][1][price] - - - true - - = - true - product[tier_price][1][delete] - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - - - true - 100500 - = - true - product[stock_data][original_inventory_qty] - - - true - 100500 - = - true - product[stock_data][qty] - - - true - 0 - = - true - product[stock_data][min_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - - - true - 1 - = - true - product[stock_data][min_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - - - true - 0 - = - true - product[stock_data][backorders] - - - true - 1 - = - true - product[stock_data][use_config_backorders] - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - - - true - 0 - = - true - product[stock_data][qty_increments] - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - - - true - 1 - = - true - product[stock_data][is_in_stock] - - - true - - = - true - product[custom_design] - - - true - - = - true - product[custom_design_from] - - - true - - = - true - product[custom_design_to] - - - true - - = - true - product[custom_layout_update] - - - true - - = - true - product[page_layout] - - - true - container2 - = - true - product[options_container] - - - true - - = - true - product[options][1][is_delete] - true - - - true - 1 - = - true - product[options][1][is_require] - - - true - select - = - true - product[options][1][previous_group] - false - - - true - drop_down - = - true - product[options][1][previous_type] - false - - - true - 0 - = - true - product[options][1][sort_order] - false - - - true - Product Option Title One - = - true - product[options][1][title] - - - true - drop_down - = - true - product[options][1][type] - - - true - - = - true - product[options][1][values][1][is_delete] - false - - - true - 200 - = - true - product[options][1][values][1][price] - - - true - fixed - = - true - product[options][1][values][1][price_type] - - - true - sku-one - = - true - product[options][1][values][1][sku] - - - true - 0 - = - true - product[options][1][values][1][sort_order] - - - true - Row Title - = - true - product[options][1][values][1][title] - - - true - - = - true - product[options][2][is_delete] - false - - - true - 1 - = - true - product[options][2][is_require] - - - true - 250 - = - true - product[options][2][max_characters] - - - true - text - = - true - product[options][2][previous_group] - - - true - field - = - true - product[options][2][previous_type] - - - true - 500 - = - true - product[options][2][price] - - - true - fixed - = - true - product[options][2][price_type] - - - true - sku-two - = - true - product[options][2][sku] - - - true - 1 - = - true - product[options][2][sort_order] - - - true - Field Title - = - true - product[options][2][title] - - - true - field - = - true - product[options][2][type] - - - true - 1 - = - true - affect_configurable_product_attributes - true - - - true - 4 - = - true - new-variations-attribute-set-id - true - - - true - - = - true - product[configurable_variation] - true - - - true - ${related_product_id} - = - true - links[related][0][id] - - - true - 1 - = - true - links[related][0][position] - - - true - ${related_product_id} - = - true - links[upsell][0][id] - - - true - 1 - = - true - links[upsell][0][position] - - - true - ${related_product_id} - = - true - links[crosssell][0][id] - - - true - 1 - = - true - links[crosssell][0][position] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/set/4/type/simple/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - violation - - Assertion.response_data - false - 6 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminProductEditingPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Edit Product"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.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) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - simpleCount = props.get("simple_products_list_for_edit").size(); - configCount = props.get("configurable_products_list_for_edit").size(); - productCount = 0; - if (simpleCount > configCount) { - productCount = configCount; - } else { - productCount = simpleCount; - } - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - threadsNumber = 1; - } - //Current thread number starts from 0 - currentThreadNum = ctx.getThreadNum(); - - String siterator = vars.get("threadIterator_" + currentThreadNum.toString()); - iterator = 0; - if(siterator == null){ - vars.put("threadIterator_" + currentThreadNum.toString() , "0"); - } else { - iterator = Integer.parseInt(siterator); - iterator ++; - vars.put("threadIterator_" + currentThreadNum.toString() , iterator.toString()); - } - - //Number of products for one thread - productClusterLength = productCount / threadsNumber; - - if (iterator >= productClusterLength) { - vars.put("threadIterator_" + currentThreadNum.toString(), "0"); - iterator = 0; - } - - //Index of the current product from the cluster - i = productClusterLength * currentThreadNum + iterator; - - //ids of simple and configurable products to edit - vars.put("simple_product_id", props.get("simple_products_list_for_edit").get(i).get("id")); - vars.put("configurable_product_id", props.get("configurable_products_list_for_edit").get(i).get("id")); - - //id of related product - do { - relatedIndex = random.nextInt(props.get("simple_products_list_for_edit").size()); - } while(i == relatedIndex); - vars.put("related_product_id", props.get("simple_products_list_for_edit").get(relatedIndex).get("id")); - } catch (Exception ex) { - log.info("Script execution failed", ex); -} - - - false - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/edit/id/${simple_product_id}/ - GET - true - false - true - false - false - - - - - - Product - - Assertion.response_data - false - 16 - - - - false - simple_product_name - ,"name":"([^'"]+)", - $1$ - - 1 - - - - false - simple_product_sku - ,"sku":"([^'"]+)", - $1$ - - 1 - - - - false - simple_product_category_id - ,"category_ids":."(\d+)". - $1$ - - 1 - - - - - Passing arguments between threads - //Additional category to be added - import java.util.Random; - - Random randomGenerator = new Random(); - int newCategoryId; - if (${seedForRandom} > 0) { - randomGenerator.setSeed(${seedForRandom} + ${__threadNum}); - } - - int categoryId = Integer.parseInt(vars.get("simple_product_category_id")); - categoryList = props.get("admin_category_ids_list"); - - if (categoryList.size() > 1) { - do { - int index = randomGenerator.nextInt(categoryList.size()); - newCategoryId = Integer.parseInt(categoryList.get(index)); - } while (categoryId == newCategoryId); - - vars.put("category_additional", newCategoryId.toString()); - } - - //New price - vars.put("price_new", "9999"); - //New special price - vars.put("special_price_new", "8888"); - //New quantity - vars.put("quantity_new", "100600"); - - - - false - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${simple_product_name} - = - true - product[name] - false - - - true - ${simple_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - ${quantity_new} - = - true - product[quantity_and_stock_status][qty] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 1.0000 - = - true - product[weight] - false - - - true - 1 - = - true - product[product_has_weight] - false - - - true - ${simple_product_category_id} - = - true - product[category_ids][] - false - - - true - <p>Full simple product Description ${simple_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - - = - true - product[configurable_variations] - false - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - - = - true - product[image] - false - - - true - - = - true - product[small_image] - false - - - true - - = - true - product[thumbnail] - false - - - true - ${simple_product_name} - = - true - product[url_key] - false - - - true - ${simple_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${simple_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${simple_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - ${quantity_new} - = - true - product[stock_data][original_inventory_qty] - false - - - true - ${quantity_new} - = - true - product[stock_data][qty] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - - = - true - new-variations-attribute-set-id - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/id/${simple_product_id}/?isAjax=true - POST - true - false - true - false - false - - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${simple_product_name} - = - true - product[name] - false - - - true - ${simple_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - ${quantity_new} - = - true - product[quantity_and_stock_status][qty] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 1.0000 - = - true - product[weight] - false - - - true - 1 - = - true - product[product_has_weight] - false - - - true - ${simple_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - - - true - <p>Full simple product Description ${simple_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - - = - true - product[configurable_variations] - false - - - true - 1 - = - true - affect_configurable_product_attributes - false - - - true - - = - true - product[image] - false - - - true - - = - true - product[small_image] - false - - - true - - = - true - product[thumbnail] - false - - - true - ${simple_product_name} - = - true - product[url_key] - false - - - true - ${simple_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${simple_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${simple_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - ${quantity_new} - = - true - product[stock_data][original_inventory_qty] - false - - - true - ${quantity_new} - = - true - product[stock_data][qty] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 10000 - = - true - product[stock_data][max_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - - = - true - new-variations-attribute-set-id - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/id/${simple_product_id}/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - - You saved the product - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/edit/id/${configurable_product_id}/ - GET - true - false - true - false - false - - - - - - Product - - Assertion.response_data - false - 16 - - - - false - configurable_product_name - ,"name":"([^'"]+)", - $1$ - - 1 - - - - false - configurable_product_sku - ,"sku":"([^'"]+)", - $1$ - - 1 - - - - false - configurable_product_category_id - ,"category_ids":."(\d+)" - $1$ - - 1 - - - - false - configurable_attribute_id - ,"configurable_variation":"([^'"]+)", - $1$ - - 1 - true - - - - false - configurable_matrix - "configurable-matrix":(\[.*?\]) - $1$ - - 1 - true - - - - associated_products_ids - $.[*].id - - configurable_matrix - VAR - - - - false - configurable_product_data - (\{"product":.*?configurable_attributes_data.*?\})\s*< - $1$ - - 1 - - - - configurable_attributes_data - $.product.configurable_attributes_data - - configurable_product_data - VAR - - - - false - configurable_attribute_ids - "attribute_id":"(\d+)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_codes - "code":"(\w+)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_labels - "label":"(.*?)" - $1$ - - -1 - variable - configurable_attributes_data - - - - false - configurable_attribute_values - "values":(\{(?:\}|.*?\}\})) - $1$ - - -1 - variable - configurable_attributes_data - - - - - configurable_attribute_ids - configurable_attribute_id - true - - - - 1 - ${configurable_attribute_ids_matchNr} - 1 - attribute_counter - - true - true - - - - return vars.get("configurable_attribute_values_" + vars.get("attribute_counter")); - - - false - - - - false - attribute_${configurable_attribute_id}_values - "value_index":"(\d+)" - $1$ - - -1 - configurable_attribute_values_${attribute_counter} - - - - - - - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${configurable_product_name} - = - true - product[name] - false - - - true - ${configurable_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id] - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 3 - = - true - product[weight] - false - - - true - ${configurable_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - false - - - true - <p>Configurable product description ${configurable_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - ${configurable_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${configurable_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${configurable_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - ${configurable_attribute_id} - = - true - product[configurable_variation] - false - - - true - ${configurable_product_name} - = - true - product[url_key] - - - true - 1 - = - true - product[use_config_gift_message_available] - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - - - true - 4 - = - true - product[visibility] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 50 - = - true - product[stock_data][qty] - false - - - true - configurable - = - true - product[stock_data][type_id] - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/validate/id/${configurable_product_id}/ - POST - true - false - true - false - false - - - - - false - - - try { - int attributesCount = Integer.parseInt(vars.get("configurable_attribute_ids_matchNr")); - for (int i = 1; i <= attributesCount; i++) { - attributeId = vars.get("configurable_attribute_ids_" + i.toString()); - attributeCode = vars.get("configurable_attribute_codes_" + i.toString()); - attributeLabel = vars.get("configurable_attribute_labels_" + i.toString()); - ctx.getCurrentSampler().addArgument("attributes[" + (i - 1).toString() + "]", attributeId); - ctx.getCurrentSampler().addArgument("attribute_codes[" + (i - 1).toString() + "]", attributeCode); - ctx.getCurrentSampler().addArgument("product[" + attributeCode + "]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][position]", (i - 1).toString()); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attributeCode); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attributeLabel); - - int valuesCount = Integer.parseInt(vars.get("attribute_" + attributeId + "_values_matchNr")); - for (int j = 1; j <= valuesCount; j++) { - attributeValue = vars.get("attribute_" + attributeId + "_values_" + j.toString()); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][include]", - "1" - ); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][value_index]", - attributeValue - ); - } - } - ctx.getCurrentSampler().addArgument("associated_product_ids_serialized", vars.get("associated_products_ids").toString()); - } catch (Exception e) { - log.error("error???", e); - } - - - - - {"error":false} - - Assertion.response_data - false - 2 - - - - - - - - true - true - = - true - ajax - false - - - true - true - = - true - isAjax - false - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${configurable_product_name} - = - true - product[name] - false - - - true - ${configurable_product_sku} - = - true - product[sku] - false - - - true - ${price_new} - = - true - product[price] - false - - - true - 2 - = - true - product[tax_class_id]admin - false - - - true - 1 - = - true - product[quantity_and_stock_status][is_in_stock] - false - - - true - 3 - = - true - product[weight] - false - - - true - ${configurable_product_category_id} - = - true - product[category_ids][] - false - - - true - ${category_additional} - = - true - product[category_ids][] - false - - - true - <p>Configurable product description ${configurable_product_id} Edited</p> - = - true - product[description] - false - - - true - 1 - = - true - product[status] - false - - - true - ${configurable_product_name} Meta Title Edited - = - true - product[meta_title] - false - - - true - ${configurable_product_name} Meta Keyword Edited - = - true - product[meta_keyword] - false - - - true - ${configurable_product_name} Meta Description Edited - = - true - product[meta_description] - false - - - true - 1 - = - true - product[website_ids][] - false - - - true - ${special_price_new} - = - true - product[special_price] - false - - - true - - = - true - product[special_from_date] - false - - - true - - = - true - product[special_to_date] - false - - - true - - = - true - product[cost] - false - - - true - 1 - = - true - product[stock_data][use_config_manage_stock] - false - - - true - 0 - = - true - product[stock_data][min_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_qty] - false - - - true - 1 - = - true - product[stock_data][min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_min_sale_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_max_sale_qty] - false - - - true - 0 - = - true - product[stock_data][is_qty_decimal] - false - - - true - 0 - = - true - product[stock_data][is_decimal_divided] - false - - - true - 0 - = - true - product[stock_data][backorders] - false - - - true - 1 - = - true - product[stock_data][use_config_backorders] - false - - - true - 1 - = - true - product[stock_data][notify_stock_qty] - false - - - true - 1 - = - true - product[stock_data][use_config_notify_stock_qty] - false - - - true - 0 - = - true - product[stock_data][enable_qty_increments] - false - - - true - 0 - = - true - product[stock_data][qty_increments] - false - - - true - 1 - = - true - product[stock_data][use_config_qty_increments] - false - - - true - 1 - = - true - product[stock_data][is_in_stock] - false - - - true - - = - true - product[custom_design] - false - - - true - - = - true - product[custom_design_from] - false - - - true - - = - true - product[custom_design_to] - false - - - true - - = - true - product[custom_layout_update] - false - - - true - - = - true - product[page_layout] - false - - - true - container2 - = - true - product[options_container] - false - - - true - ${configurable_attribute_id} - = - true - product[configurable_variation] - false - - - true - ${configurable_product_name} - = - true - product[url_key] - - - true - 1 - = - true - product[use_config_gift_message_available] - - - true - 1 - = - true - product[use_config_gift_wrapping_available] - - - true - 4 - = - true - product[visibility] - - - true - 1 - = - true - product[product_has_weight] - true - - - true - 50 - = - true - product[stock_data][qty] - false - - - true - configurable - = - true - product[stock_data][type_id] - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/product/save/id/${configurable_product_id}/back/edit/active_tab/product-details/ - POST - true - false - true - false - false - - - - - false - - - try { - int attributesCount = Integer.parseInt(vars.get("configurable_attribute_ids_matchNr")); - for (int i = 1; i <= attributesCount; i++) { - attributeId = vars.get("configurable_attribute_ids_" + i.toString()); - attributeCode = vars.get("configurable_attribute_codes_" + i.toString()); - attributeLabel = vars.get("configurable_attribute_labels_" + i.toString()); - ctx.getCurrentSampler().addArgument("attributes[" + (i - 1).toString() + "]", attributeId); - ctx.getCurrentSampler().addArgument("attribute_codes[" + (i - 1).toString() + "]", attributeCode); - ctx.getCurrentSampler().addArgument("product[" + attributeCode + "]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][attribute_id]", attributeId); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][position]", (i - 1).toString()); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][code]", attributeCode); - ctx.getCurrentSampler().addArgument("product[configurable_attributes_data][" + attributeId + "][label]", attributeLabel); - - int valuesCount = Integer.parseInt(vars.get("attribute_" + attributeId + "_values_matchNr")); - for (int j = 1; j <= valuesCount; j++) { - attributeValue = vars.get("attribute_" + attributeId + "_values_" + j.toString()); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][include]", - "1" - ); - ctx.getCurrentSampler().addArgument( - "product[configurable_attributes_data][" + attributeId + "][values][" + attributeValue + "][value_index]", - attributeValue - ); - } - } - ctx.getCurrentSampler().addArgument("associated_product_ids_serialized", vars.get("associated_products_ids").toString()); - } catch (Exception e) { - log.error("error???", e); - } - - - - - You saved the product - - Assertion.response_data - false - 2 - if have trouble see messages-message-error - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminReturnsManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Returns Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/orders_page.jmx - - - - Create New Order - - Assertion.response_data - false - 2 - - - - - - - - - true - sales_order_grid - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 200 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - increment_id - = - true - sorting[field] - - - true - desc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - false - - - true - pending - = - true - filters[status] - true - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - sales_order_grid - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - 200 - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - increment_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - true - pending - = - true - filters[status] - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/search_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - false - order_numbers - \"increment_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - false - order_ids - \"entity_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - - - tool/fragments/ce/admin_create_process_returns/setup.jmx - - import java.util.ArrayList; - import java.util.HashMap; - import org.apache.jmeter.protocol.http.util.Base64Encoder; - import java.util.Random; - - // get count of "order_numbers" variable defined in "Search Pending Orders Limit" - int ordersCount = Integer.parseInt(vars.get("order_numbers_matchNr")); - - - int clusterLength; - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - //Number of orders for one thread - clusterLength = ordersCount; - } else { - clusterLength = Math.round(ordersCount / threadsNumber); - if (clusterLength == 0) { - clusterLength = 1; - } - } - - //Current thread number starts from 0 - int currentThreadNum = ctx.getThreadNum(); - - //Index of the current product from the cluster - Random random = new Random(); - if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - int iterator = random.nextInt(clusterLength); - if (iterator == 0) { - iterator = 1; - } - - int i = clusterLength * currentThreadNum + iterator; - - orderNumber = vars.get("order_numbers_" + i.toString()); - orderId = vars.get("order_ids_" + i.toString()); - vars.put("order_number", orderNumber); - vars.put("order_id", orderId); - - - - - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/view/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_order.jmx - - - - #${order_number} - - Assertion.response_data - false - 2 - - - - false - order_status - <span id="order_status">([^<]+)</span> - $1$ - - 1 - simple_products - - - - - - "${order_status}" == "Pending" - false - tool/fragments/ce/admin_edit_order/if_controller.jmx - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_start.jmx - - - - Invoice Totals - - Assertion.response_data - false - 2 - - - - false - item_ids - <div id="order_item_(\d+)_title"\s*class="product-title"> - $1$ - - -1 - simple_products - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - invoice[items][${item_ids_1}] - - - true - 1 - = - true - invoice[items][${item_ids_2}] - - - true - Invoiced - = - true - invoice[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx - - - - The invoice has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_creditmemo/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/credit_memo_start.jmx - - - - New Memo - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - creditmemo[items][${item_ids_1}][qty] - - - true - 1 - = - true - creditmemo[items][${item_ids_2}][qty] - - - true - 1 - = - true - creditmemo[do_offline] - - - true - Credit Memo added - = - true - creditmemo[comment_text] - - - true - 10 - = - true - creditmemo[shipping_amount] - - - true - 0 - = - true - creditmemo[adjustment_positive] - - - true - 0 - = - true - creditmemo[adjustment_negative] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_creditmemo/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/credit_memo_full_refund.jmx - - - - You created the credit memo - - Assertion.response_data - false - 2 - - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCreateProcessReturnsDelay}*1000))} - tool/fragments/ce/admin_create_process_returns/pause.jmx - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminBrowseCustomerGridPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Browse Customer Grid"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - - vars.put("gridEntityType" , "Customer"); - - pagesCount = parseInt(vars.get("customers_page_size")) || 20; - vars.put("grid_entity_page_size" , pagesCount); - vars.put("grid_namespace" , "customer_listing"); - vars.put("grid_admin_browse_filter_text" , vars.get("admin_browse_customer_filter_text")); - vars.put("grid_filter_field", "name"); - - // set sort fields and sort directions - vars.put("grid_sort_field_1", "name"); - vars.put("grid_sort_field_2", "group_id"); - vars.put("grid_sort_field_3", "billing_country_id"); - vars.put("grid_sort_order_1", "asc"); - vars.put("grid_sort_order_2", "desc"); - - javascript - tool/fragments/ce/admin_browse_customers_grid/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; - var totalsRecord = parseInt(vars.get("entity_total_records")); - var pageCount = Math.round(totalsRecord/pageSize); - - vars.put("grid_pages_count", pageCount); - - javascript - - - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - ${grid_admin_browse_filter_text} - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/set_filtered_pages_count.jmx - - - $.totalRecords - 0 - true - false - true - true - - - - entity_total_records - $.totalRecords - - - BODY - - - - - - - var pageSize = parseInt(vars.get("grid_entity_page_size")) || 20; -var totalsRecord = parseInt(vars.get("entity_total_records")); -var pageCount = Math.round(totalsRecord/pageSize); - -vars.put("grid_pages_count_filtered", pageCount); - - javascript - - - - - - 1 - ${grid_pages_count} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_page_number.jmx - - - - - - - true - ${grid_namespace} - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - true - - - true - ${page_number} - = - true - paging[current] - true - - - true - entity_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid.jmx - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - 1 - ${grid_pages_count_filtered} - 1 - page_number - - true - false - tool/fragments/ce/admin_grid_browsing/select_filtered_page_number.jmx - - - - tool/fragments/ce/admin_grid_browsing/admin_browse_grid_sort_and_filter.jmx - - - - grid_sort_field - grid_sort_field - true - 0 - 3 - - - - grid_sort_order - grid_sort_order - true - 0 - 2 - - - - - - - true - ${grid_namespace} - = - true - namespace - false - - - true - ${grid_admin_browse_filter_text} - = - true - filters[${grid_filter_field}] - false - - - true - true - = - true - filters[placeholder] - false - - - true - ${grid_entity_page_size} - = - true - paging[pageSize] - false - - - true - ${page_number} - = - true - paging[current] - false - - - true - ${grid_sort_field} - = - true - sorting[field] - false - - - true - ${grid_sort_order} - = - true - sorting[direction] - false - - - true - true - = - true - isAjax - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":[^0]\d* - - Assertion.response_data - false - 2 - - - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminCreateOrderPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Create Order"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - javascript - - - - - vars.put("alabama_region_id", props.get("alabama_region_id")); - vars.put("california_region_id", props.get("california_region_id")); - - tool/fragments/ce/common/get_region_data.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(); - -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); -simpleList = props.get("simple_products_list").get(number1); -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")); - - -customers_index = 0; -if (!props.containsKey("customer_ids_index")) { - props.put("customer_ids_index", customers_index); -} - -try { - customers_index = props.get("customer_ids_index"); - customers_list = props.get("customer_ids_list"); - - if (customers_index == customers_list.size()) { - customers_index=0; - } - vars.put("customer_id", customers_list.get(customers_index)); - props.put("customer_ids_index", ++customers_index); -} -catch (java.lang.Exception e) { - log.error("Caught Exception in 'Admin Create Order' thread."); - SampleResult.setStopThread(true); -} - - - true - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/start/ - GET - true - false - true - false - false - - Detected the start of a redirect chain - - - - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${configurable_product_1_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - true - item[${simple_product_1_id}][qty] - 1 - = - true - - - true - item[${simple_product_2_id}][qty] - 1 - = - true - - - true - item[${configurable_product_1_id}][qty] - 1 - = - true - - - true - customer_id - ${customer_id} - = - true - - - true - store_id - 1 - = - true - - - true - currency_id - - = - true - - - true - form_key - ${admin_form_key} - = - true - - - true - payment[method] - checkmo - = - true - - - true - reset_shipping - 1 - = - true - - - true - json - 1 - = - true - - - true - as_js_varname - iFrameResponse - = - true - - - true - form_key - ${admin_form_key} - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/loadBlock/block/search,items,shipping_method,totals,giftmessage,billing_method?isAjax=true - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - false - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - - ctx.getCurrentSampler().addArgument("item[" + vars.get("configurable_product_1_id") + "][super_attribute][" + attribute_ids_array[i] + "]", option_values_array[i]); - } -} catch (Exception e) { - log.error("error???", e); -} - - - - - - - - true - collect_shipping_rates - 1 - = - true - - - true - customer_id - ${customer_id} - = - true - - - true - store_id - 1 - = - true - - - true - currency_id - false - = - true - - - true - form_key - ${admin_form_key} - = - true - - - true - payment[method] - checkmo - = - true - - - true - json - true - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/loadBlock/block/shipping_method,totals?isAjax=true - POST - true - false - true - false - false - - - - - - shipping_method - Flat Rate - - Assertion.response_data - false - 2 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/index/ - GET - true - false - true - false - false - - Detected the start of a redirect chain - - - - - Select from existing customer addresses - Submit Order - Items Ordered - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - limit - 20 - = - true - - - true - entity_id - - = - true - - - true - name - - = - true - - - true - email - - = - true - - - true - Telephone - - = - true - - - true - billing_postcode - - = - true - - - true - billing_country_id - - = - true - - - true - billing_regione - - = - true - - - true - store_name - - = - true - - - true - page - 1 - = - true - - - true - order[currency] - USD - = - true - - - true - sku - - = - true - - - true - qty - - = - true - - - true - limit - 20 - = - true - - - true - entity_id - - = - true - - - true - name - - = - true - - - true - sku - - = - true - - - true - price[from] - - = - true - - - true - price[to] - - = - true - - - true - in_products - - = - true - - - true - page - 1 - = - true - - - true - coupon_code - - = - true - - - true - order[account][group_id] - 1 - = - true - - - true - order[account][email] - user_${customer_id}@example.com - = - true - - - true - order[billing_address][customer_address_id] - - = - true - - - true - order[billing_address][prefix] - - = - true - - - true - order[billing_address][firstname] - Anthony - = - true - - - true - order[billing_address][middlename] - - = - true - - - true - order[billing_address][lastname] - Nealy - = - true - - - true - order[billing_address][suffix] - - = - true - - - true - order[billing_address][company] - - = - true - - - true - order[billing_address][street][0] - 123 Freedom Blvd. #123 - = - true - - - true - order[billing_address][street][1] - - = - true - - - true - order[billing_address][city] - Fayetteville - = - true - - - true - order[billing_address][country_id] - US - = - true - - - true - order[billing_address][region] - - = - true - - - true - order[billing_address][region_id] - ${alabama_region_id} - = - true - - - true - order[billing_address][postcode] - 123123 - = - true - - - true - order[billing_address][telephone] - 022-333-4455 - = - true - - - true - order[billing_address][fax] - - = - true - - - true - order[billing_address][vat_id] - - = - true - - - true - shipping_same_as_billing - on - = - true - - - true - payment[method] - checkmo - = - true - - - true - order[shipping_method] - flatrate_flatrate - = - true - - - true - order[comment][customer_note] - - = - true - - - true - order[comment][customer_note_notify] - 1 - = - true - - - true - order[send_confirmation] - 1 - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_create/save/ - POST - true - false - true - true - false - - Detected the start of a redirect chain - - - - false - order_id - ${host}${base_path}${admin_path}/sales/order/index/order_id/(\d+)/ - $1$ - - 1 - - - - false - order_item_1 - order_item_(\d+)_title - $1$ - - 1 - - - - false - order_item_2 - order_item_(\d+)_title - $1$ - - 2 - - - - false - order_item_3 - order_item_(\d+)_title - $1$ - - 3 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_2 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_item_3 - - - - - You created the order. - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - invoice[items][${order_item_1}] - 1 - = - true - - - true - invoice[items][${order_item_2}] - 1 - = - true - - - true - invoice[items][${order_item_3}] - 1 - = - true - - - true - invoice[comment_text] - - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - - The invoice has been created. - - Assertion.response_data - false - 2 - - - - - - - - true - form_key - ${admin_form_key} - = - true - - - true - shipment[items][${order_item_1}] - 1 - = - true - - - true - shipment[items][${order_item_2}] - 1 - = - true - - - true - shipment[items][${order_item_3}] - 1 - = - true - - - true - shipment[comment_text] - - = - true - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/ - POST - true - false - true - false - false - - Detected the start of a redirect chain - - - - - The shipment has been created. - - Assertion.response_data - false - 2 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminCategoryManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Category Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_category_management/admin_category_management.jmx - - - - javascript - - - - random = new java.util.Random(); -if (${seedForRandom} > 0) { -random.setSeed(${seedForRandom} + ${__threadNum}); -} - -/** - * Get unique ids for fix concurrent category saving - */ -function getNextProductNumber(i) { - number = productsVariationsSize * ${__threadNum} - i; - if (number >= productsSize) { - log.info("${testLabel}: capacity of product list is not enough for support all ${adminPoolUsers} threads"); - return random.nextInt(productsSize); - } - return productsVariationsSize * ${__threadNum} - i; -} - -var productsVariationsSize = 5, - productsSize = props.get("simple_products_list_for_edit").size(); - - -for (i = 1; i<= productsVariationsSize; i++) { - var productVariablePrefix = "simple_product_" + i + "_"; - number = getNextProductNumber(i); - simpleList = props.get("simple_products_list_for_edit").get(number); - - vars.put(productVariablePrefix + "url_key", simpleList.get("url_key")); - vars.put(productVariablePrefix + "id", simpleList.get("id")); - vars.put(productVariablePrefix + "name", simpleList.get("title")); -} - -categoryIndex = random.nextInt(props.get("admin_category_ids_list").size()); -vars.put("parent_category_id", props.get("admin_category_ids_list").get(categoryIndex)); -do { -categoryIndexNew = random.nextInt(props.get("admin_category_ids_list").size()); -} while(categoryIndex == categoryIndexNew); -vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(categoryIndexNew)); - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/edit/id/${parent_category_id}/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/add/store/0/parent/${parent_category_id} - GET - true - false - true - false - false - - - - - - <title>New Category - - Assertion.response_data - false - 2 - - - - - - - - true - - = - true - id - - - true - ${parent_category_id} - = - true - parent - - - true - - = - true - path - - - true - - = - true - store_id - - - true - 0 - = - true - is_active - - - true - 0 - = - true - include_in_menu - - - true - 1 - = - true - is_anchor - - - true - true - = - true - use_config[available_sort_by] - - - true - true - = - true - use_config[default_sort_by] - - - true - true - = - true - use_config[filter_price_range] - - - true - false - = - true - use_default[url_key] - - - true - 0 - = - true - url_key_create_redirect - - - true - 0 - = - true - custom_use_parent_settings - - - true - 0 - = - true - custom_apply_to_products - - - true - Admin Category Management ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - name - - - true - admin-category-management-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - url_key - - - true - - = - true - meta_title - - - true - - = - true - description - - - true - PRODUCTS - = - true - display_mode - - - true - position - = - true - default_sort_by - - - true - - = - true - meta_keywords - - - true - - = - true - meta_description - - - true - - = - true - custom_layout_update - - - false - {"${simple_product_1_id}":"","${simple_product_2_id}":"","${simple_product_3_id}":"","${simple_product_4_id}":"","${simple_product_5_id}":""} - = - true - category_products - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/save/ - POST - true - false - true - false - false - - - - - URL - admin_category_id - /catalog/category/edit/id/(\d+)/ - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_id - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/edit/id/${admin_category_id}/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - false - admin_category_entity_id - "entity_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_attribute_set_id - "attribute_set_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_parent_id - "parent_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_created_at - "created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_updated_at - "updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_path - "entity_id":(.+)"path":"([^\"]+)" - $2$ - - 1 - - - - false - admin_category_level - "level":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_name - "entity_id":(.+)"name":"([^"]+)" - $2$ - - 1 - - - - false - admin_category_url_key - "url_key":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_url_path - "url_path":"([^"]+)" - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_entity_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_attribute_set_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_parent_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_updated_at - - - - - ^[\d\\\/]+$ - - Assertion.response_data - false - 1 - variable - admin_category_path - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_level - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_name - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_url_key - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_url_path - - - - - ${simple_product_1_name} - ${simple_product_2_name} - ${simple_product_3_name} - ${simple_product_4_name} - ${simple_product_5_name} - - Assertion.response_data - false - 2 - - - - - - - - true - ${admin_category_id} - = - true - id - - - true - ${admin_form_key} - = - true - form_key - - - true - append - = - true - point - - - true - ${new_parent_category_id} - = - true - pid - - - true - ${parent_category_id} - = - true - paid - - - true - 0 - = - true - aid - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/move/ - POST - true - false - true - false - false - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/delete/id/${admin_category_id}/ - POST - true - false - true - false - false - - - - - - You deleted the category. - - Assertion.response_data - false - 2 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCategoryManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminPromotionRulesPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Promotion Rules"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/ - GET - true - false - true - false - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/new - GET - true - false - true - false - false - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - true - - - true - 1--1 - = - true - id - - - true - Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal - = - true - type - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/newConditionHtml/form/sales_rule_formrule_conditions_fieldset_/form_namespace/sales_rule_form - POST - true - false - true - false - false - - - - - - - - true - Rule Name ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - name - - - true - 0 - = - true - is_active - - - true - 0 - = - true - use_auto_generation - - - true - 1 - = - true - is_rss - - - true - 0 - = - true - apply_to_shipping - - - true - 0 - = - true - stop_rules_processing - - - true - - = - true - coupon_code - - - true - - = - true - uses_per_coupon - - - true - - = - true - uses_per_customer - - - true - - = - true - sort_order - - - true - 5 - = - true - discount_amount - - - true - 0 - = - true - discount_qty - - - true - - = - true - discount_step - - - true - - = - true - reward_points_delta - - - true - - = - true - store_labels[0] - - - true - Rule Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - description - - - true - 1 - = - true - coupon_type - - - true - cart_fixed - = - true - simple_action - - - true - 1 - = - true - website_ids[0] - - - true - 0 - = - true - customer_group_ids[0] - - - true - - = - true - from_date - - - true - - = - true - to_date - - - true - Magento\SalesRule\Model\Rule\Condition\Combine - = - true - rule[conditions][1][type] - - - true - all - = - true - rule[conditions][1][aggregator] - - - true - 1 - = - true - rule[conditions][1][value] - - - true - Magento\SalesRule\Model\Rule\Condition\Address - = - true - rule[conditions][1--1][type] - - - true - base_subtotal - = - true - rule[conditions][1--1][attribute] - - - true - >= - = - true - rule[conditions][1--1][operator] - - - true - 100 - = - true - rule[conditions][1--1][value] - - - true - - = - true - rule[conditions][1][new_chlid] - - - true - Magento\SalesRule\Model\Rule\Condition\Product\Combine - = - true - rule[actions][1][type] - - - true - all - = - true - rule[actions][1][aggregator] - - - true - 1 - = - true - rule[actions][1][value] - - - true - - = - true - rule[actions][1][new_child] - - - true - - = - true - store_labels[1] - - - true - - = - true - store_labels[2] - - - true - - = - true - related_banners - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/save/ - POST - true - false - true - false - false - - - - - - You saved the rule. - - Assertion.response_data - false - 16 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminPromotionsManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminCustomerManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Customer Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_customer_management/admin_customer_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - true - customer_listing - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 20 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - - - true - customer_listing - = - true - namespace - - - true - Lastname - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 20 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - false - customer_edit_url_path - actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/", - /customer/index/edit/id/$2$/ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - customer_edit_url_path - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}${customer_edit_url_path} - GET - true - false - true - false - false - - - - - - Customer Information - - Assertion.response_data - false - 2 - - - - false - admin_customer_entity_id - "entity_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_website_id - "website_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_firstname - "firstname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_lastname - "lastname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_email - "email":"([^\@]+@[^.]+.[^"]+)" - $1$ - - 1 - - - - false - admin_customer_group_id - "group_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_store_id - "store_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_created_at - "created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_updated_at - "updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_is_active - "is_active":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_disable_auto_group_change - "disable_auto_group_change":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_created_in - "created_in":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_dob - "dob":"(\d+)-(\d+)-(\d+)" - $2$/$3$/$1$ - - 1 - - - - false - admin_customer_default_billing - "default_billing":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_default_shipping - "default_shipping":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_gender - "gender":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_failures_num - "failures_num":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_address_entity_id - _address":\{"entity_id":"(\d+)".+?"parent_id":"${admin_customer_entity_id}" - $1$ - - 1 - - - - false - admin_customer_address_created_at - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_updated_at - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_is_active - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"is_active":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_address_city - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"city":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_country_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"country_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_firstname - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"firstname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_lastname - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"lastname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_postcode - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"postcode":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_region - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_region_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_street - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"street":\["([^"]+)"\] - $1$ - - 1 - - - - false - admin_customer_address_telephone - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"telephone":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_customer_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"customer_id":"([^"]+)" - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_entity_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_website_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_firstname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_lastname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_email - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_group_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_store_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_updated_at - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_is_active - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_disable_auto_group_change - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_created_in - - - - - ^\d+/\d+/\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_dob - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_default_billing - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_default_shipping - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_gender - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_failures_num - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_entity_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_updated_at - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_is_active - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_city - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_country_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_firstname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_lastname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_postcode - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_region - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_region_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_street - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_telephone - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_customer_id - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_customer_entity_id} - = - true - customer[entity_id] - - - true - ${admin_customer_website_id} - = - true - customer[website_id] - - - true - ${admin_customer_email} - = - true - customer[email] - - - true - ${admin_customer_group_id} - = - true - customer[group_id] - - - true - ${admin_customer_store_id} - = - true - customer[store_id] - - - true - ${admin_customer_created_at} - = - true - customer[created_at] - - - true - ${admin_customer_updated_at} - = - true - customer[updated_at] - - - true - ${admin_customer_is_active} - = - true - customer[is_active] - - - true - ${admin_customer_disable_auto_group_change} - = - true - customer[disable_auto_group_change] - - - true - ${admin_customer_created_in} - = - true - customer[created_in] - - - true - - = - true - customer[prefix] - - - true - ${admin_customer_firstname} 1 - = - true - customer[firstname] - - - true - - = - true - customer[middlename] - - - true - ${admin_customer_lastname} 1 - = - true - customer[lastname] - - - true - - = - true - customer[suffix] - - - true - ${admin_customer_dob} - = - true - customer[dob] - - - true - ${admin_customer_default_billing} - = - true - customer[default_billing] - - - true - ${admin_customer_default_shipping} - = - true - customer[default_shipping] - - - true - - = - true - customer[taxvat] - - - true - ${admin_customer_gender} - = - true - customer[gender] - - - true - ${admin_customer_failures_num} - = - true - customer[failures_num] - - - true - ${admin_customer_store_id} - = - true - customer[sendemail_store_id] - - - true - ${admin_customer_address_entity_id} - = - true - address[${admin_customer_address_entity_id}][entity_id] - - - true - ${admin_customer_address_created_at} - = - true - address[${admin_customer_address_entity_id}][created_at] - - - true - ${admin_customer_address_updated_at} - = - true - address[${admin_customer_address_entity_id}][updated_at] - - - true - ${admin_customer_address_is_active} - = - true - address[${admin_customer_address_entity_id}][is_active] - - - true - ${admin_customer_address_city} - = - true - address[${admin_customer_address_entity_id}][city] - - - true - - = - true - address[${admin_customer_address_entity_id}][company] - - - true - ${admin_customer_address_country_id} - = - true - address[${admin_customer_address_entity_id}][country_id] - - - true - ${admin_customer_address_firstname} - = - true - address[${admin_customer_address_entity_id}][firstname] - - - true - ${admin_customer_address_lastname} - = - true - address[${admin_customer_address_entity_id}][lastname] - - - true - - = - true - address[${admin_customer_address_entity_id}][middlename] - - - true - ${admin_customer_address_postcode} - = - true - address[${admin_customer_address_entity_id}][postcode] - - - true - - = - true - address[${admin_customer_address_entity_id}][prefix] - - - true - ${admin_customer_address_region} - = - true - address[${admin_customer_address_entity_id}][region] - - - true - ${admin_customer_address_region_id} - = - true - address[${admin_customer_address_entity_id}][region_id] - - - true - ${admin_customer_address_street} - = - true - address[${admin_customer_address_entity_id}][street][0] - - - true - - = - true - address[${admin_customer_address_entity_id}][street][1] - - - true - - = - true - address[${admin_customer_address_entity_id}][suffix] - - - true - ${admin_customer_address_telephone} - = - true - address[${admin_customer_address_entity_id}][telephone] - - - true - - = - true - address[${admin_customer_address_entity_id}][vat_id] - - - true - ${admin_customer_address_customer_id} - = - true - address[${admin_customer_address_entity_id}][customer_id] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_billing] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_shipping] - - - true - - = - true - address[new_0][prefix] - - - true - John - = - true - address[new_0][firstname] - - - true - - = - true - address[new_0][middlename] - - - true - Doe - = - true - address[new_0][lastname] - - - true - - = - true - address[new_0][suffix] - - - true - Test Company - = - true - address[new_0][company] - - - true - Folsom - = - true - address[new_0][city] - - - true - 95630 - = - true - address[new_0][postcode] - - - true - 1234567890 - = - true - address[new_0][telephone] - - - true - - = - true - address[new_0][vat_id] - - - true - false - = - true - address[new_0][default_billing] - - - true - false - = - true - address[new_0][default_shipping] - - - true - 123 Main - = - true - address[new_0][street][0] - - - true - - = - true - address[new_0][street][1] - - - true - - = - true - address[new_0][region] - - - true - US - = - true - address[new_0][country_id] - - - true - ${admin_customer_address_region_id} - = - true - address[new_0][region_id] - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index/validate/ - POST - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 16 - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_customer_entity_id} - = - true - customer[entity_id] - - - true - ${admin_customer_website_id} - = - true - customer[website_id] - - - true - ${admin_customer_email} - = - true - customer[email] - - - true - ${admin_customer_group_id} - = - true - customer[group_id] - - - true - ${admin_customer_store_id} - = - true - customer[store_id] - - - true - ${admin_customer_created_at} - = - true - customer[created_at] - - - true - ${admin_customer_updated_at} - = - true - customer[updated_at] - - - true - ${admin_customer_is_active} - = - true - customer[is_active] - - - true - ${admin_customer_disable_auto_group_change} - = - true - customer[disable_auto_group_change] - - - true - ${admin_customer_created_in} - = - true - customer[created_in] - - - true - - = - true - customer[prefix] - - - true - ${admin_customer_firstname} 1 - = - true - customer[firstname] - - - true - - = - true - customer[middlename] - - - true - ${admin_customer_lastname} 1 - = - true - customer[lastname] - - - true - - = - true - customer[suffix] - - - true - ${admin_customer_dob} - = - true - customer[dob] - - - true - ${admin_customer_default_billing} - = - true - customer[default_billing] - - - true - ${admin_customer_default_shipping} - = - true - customer[default_shipping] - - - true - - = - true - customer[taxvat] - - - true - ${admin_customer_gender} - = - true - customer[gender] - - - true - ${admin_customer_failures_num} - = - true - customer[failures_num] - - - true - ${admin_customer_store_id} - = - true - customer[sendemail_store_id] - - - true - ${admin_customer_address_entity_id} - = - true - address[${admin_customer_address_entity_id}][entity_id] - - - - true - ${admin_customer_address_created_at} - = - true - address[${admin_customer_address_entity_id}][created_at] - - - true - ${admin_customer_address_updated_at} - = - true - address[${admin_customer_address_entity_id}][updated_at] - - - true - ${admin_customer_address_is_active} - = - true - address[${admin_customer_address_entity_id}][is_active] - - - true - ${admin_customer_address_city} - = - true - address[${admin_customer_address_entity_id}][city] - - - true - - = - true - address[${admin_customer_address_entity_id}][company] - - - true - ${admin_customer_address_country_id} - = - true - address[${admin_customer_address_entity_id}][country_id] - - - true - ${admin_customer_address_firstname} - = - true - address[${admin_customer_address_entity_id}][firstname] - - - true - ${admin_customer_address_lastname} - = - true - address[${admin_customer_address_entity_id}][lastname] - - - true - - = - true - address[${admin_customer_address_entity_id}][middlename] - - - true - ${admin_customer_address_postcode} - = - true - address[${admin_customer_address_entity_id}][postcode] - - - true - - = - true - address[${admin_customer_address_entity_id}][prefix] - - - true - ${admin_customer_address_region} - = - true - address[${admin_customer_address_entity_id}][region] - - - true - ${admin_customer_address_region_id} - = - true - address[${admin_customer_address_entity_id}][region_id] - - - true - ${admin_customer_address_street} - = - true - address[${admin_customer_address_entity_id}][street][0] - - - true - - = - true - address[${admin_customer_address_entity_id}][street][1] - - - true - - = - true - address[${admin_customer_address_entity_id}][suffix] - - - true - ${admin_customer_address_telephone} - = - true - address[${admin_customer_address_entity_id}][telephone] - - - true - - = - true - address[${admin_customer_address_entity_id}][vat_id] - - - true - ${admin_customer_address_customer_id} - = - true - address[${admin_customer_address_entity_id}][customer_id] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_billing] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_shipping] - - - true - - = - true - address[new_0][prefix] - - - true - John - = - true - address[new_0][firstname] - - - true - - = - true - address[new_0][middlename] - - - true - Doe - = - true - address[new_0][lastname] - - - true - - = - true - address[new_0][suffix] - - - true - Test Company - = - true - address[new_0][company] - - - true - Folsom - = - true - address[new_0][city] - - - true - 95630 - = - true - address[new_0][postcode] - - - true - 1234567890 - = - true - address[new_0][telephone] - - - true - - = - true - address[new_0][vat_id] - - - true - false - = - true - address[new_0][default_billing] - - - true - false - = - true - address[new_0][default_shipping] - - - true - 123 Main - = - true - address[new_0][street][0] - - - true - - = - true - address[new_0][street][1] - - - true - - = - true - address[new_0][region] - - - true - US - = - true - address[new_0][country_id] - - - true - 12 - = - true - address[new_0][region_id] - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index/save/ - POST - true - false - true - true - false - - - - - - You saved the customer. - - Assertion.response_data - false - 2 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCustomerManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${cAdminEditOrderPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "[REST API C] Admin Edit Order"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/orders_page.jmx - - - - Create New Order - - Assertion.response_data - false - 2 - - - - - - - - - true - sales_order_grid - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 200 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - increment_id - = - true - sorting[field] - - - true - desc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - false - - - true - pending - = - true - filters[status] - true - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - sales_order_grid - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - 200 - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - increment_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - true - pending - = - true - filters[status] - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/search_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - false - order_numbers - \"increment_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - false - order_ids - \"entity_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - - - tool/fragments/ce/admin_create_process_returns/setup.jmx - - import java.util.ArrayList; - import java.util.HashMap; - import org.apache.jmeter.protocol.http.util.Base64Encoder; - import java.util.Random; - - // get count of "order_numbers" variable defined in "Search Pending Orders Limit" - int ordersCount = Integer.parseInt(vars.get("order_numbers_matchNr")); - - - int clusterLength; - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - //Number of orders for one thread - clusterLength = ordersCount; - } else { - clusterLength = Math.round(ordersCount / threadsNumber); - if (clusterLength == 0) { - clusterLength = 1; - } - } - - //Current thread number starts from 0 - int currentThreadNum = ctx.getThreadNum(); - - //Index of the current product from the cluster - Random random = new Random(); - if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - int iterator = random.nextInt(clusterLength); - if (iterator == 0) { - iterator = 1; - } - - int i = clusterLength * currentThreadNum + iterator; - - orderNumber = vars.get("order_numbers_" + i.toString()); - orderId = vars.get("order_ids_" + i.toString()); - vars.put("order_number", orderNumber); - vars.put("order_id", orderId); - - - - - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/view/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_order.jmx - - - - #${order_number} - - Assertion.response_data - false - 2 - - - - false - order_status - <span id="order_status">([^<]+)</span> - $1$ - - 1 - simple_products - - - - - - "${order_status}" == "Pending" - false - tool/fragments/ce/admin_edit_order/if_controller.jmx - - - - - - true - pending - = - true - history[status] - false - - - true - Some text - = - true - history[comment] - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/addComment/order_id/${order_id}/?isAjax=true - POST - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/add_comment.jmx - - - - Not Notified - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_start.jmx - - - - Invoice Totals - - Assertion.response_data - false - 2 - - - - false - item_ids - <div id="order_item_(\d+)_title"\s*class="product-title"> - $1$ - - -1 - simple_products - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - invoice[items][${item_ids_1}] - - - true - 1 - = - true - invoice[items][${item_ids_2}] - - - true - Invoiced - = - true - invoice[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx - - - - The invoice has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/shipment_start.jmx - - - - New Shipment - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - shipment[items][${item_ids_1}] - - - true - 1 - = - true - shipment[items][${item_ids_2}] - - - true - Shipped - = - true - shipment[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/shipment_submit.jmx - - - - The shipment has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - - - continue - - false - ${loops} - - ${oneThreadScenariosPoolUsers} - ${ramp_period} - 1505803944000 - 1505803944000 - false - - - tool/fragments/_system/thread_group.jmx - - - 1 - false - 1 - ${importProductsPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Import Products"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - vars.put("entity", "catalog_product"); -String behavior = "${adminImportProductBehavior}"; -vars.put("adminImportBehavior", behavior); -String filepath = "${files_folder}${adminImportProductFilePath}"; -vars.put("adminImportFilePath", filepath); - - - true - tool/fragments/ce/import_products/setup.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/import/ - GET - true - false - true - false - false - - tool/fragments/ce/common/import.jmx - - - - Import Settings - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${entity} - = - true - entity - - - true - ${adminImportBehavior} - = - true - behavior - - - true - validation-stop-on-errors - = - true - validation_strategy - - - true - 10 - = - true - allowed_error_count - - - true - , - = - true - _import_field_separator - - - true - , - = - true - _import_multiple_value_separator - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/import/validate - POST - true - false - true - false - HttpClient4 - - - - ${adminImportFilePath} - import_file - application/vnd.ms-excel - - - - false - - tool/fragments/ce/common/import_validate.jmx - - - - File is valid! To start import process - Checked rows: 1000, checked entities: 1000 - - Assertion.response_data - false - 16 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${entity} - = - true - entity - - - true - ${adminImportBehavior} - = - true - behavior - - - true - validation-stop-on-errors - = - true - validation_strategy - false - - - true - 10 - = - true - allowed_error_count - false - - - true - , - = - true - _import_field_separator - false - - - true - , - = - true - _import_multiple_value_separator - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/import/start - POST - true - false - true - false - HttpClient4 - - - - ${adminImportFilePath} - import_file - application/vnd.ms-excel - - - - false - - tool/fragments/ce/common/import_save.jmx - - - - Import successfully done - - Assertion.response_data - false - 16 - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${importCustomersPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Import Customers"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - vars.put("entity", "customer"); -String behavior = "${adminImportCustomerBehavior}"; -vars.put("adminImportBehavior", behavior); -String filepath = "${files_folder}${adminImportCustomerFilePath}"; -vars.put("adminImportFilePath", filepath); - - - true - tool/fragments/ce/import_customers/setup.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/import/ - GET - true - false - true - false - false - - tool/fragments/ce/common/import.jmx - - - - Import Settings - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${entity} - = - true - entity - - - true - ${adminImportBehavior} - = - true - behavior - - - true - validation-stop-on-errors - = - true - validation_strategy - - - true - 10 - = - true - allowed_error_count - - - true - , - = - true - _import_field_separator - - - true - , - = - true - _import_multiple_value_separator - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/import/validate - POST - true - false - true - false - HttpClient4 - - - - ${adminImportFilePath} - import_file - application/vnd.ms-excel - - - - false - - tool/fragments/ce/common/import_validate.jmx - - - - File is valid! To start import process - Checked rows: 1000, checked entities: 1000 - - Assertion.response_data - false - 16 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - ${entity} - = - true - entity - - - true - ${adminImportBehavior} - = - true - behavior - - - true - validation-stop-on-errors - = - true - validation_strategy - false - - - true - 10 - = - true - allowed_error_count - false - - - true - , - = - true - _import_field_separator - false - - - true - , - = - true - _import_multiple_value_separator - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/import/start - POST - true - false - true - false - HttpClient4 - - - - ${adminImportFilePath} - import_file - application/vnd.ms-excel - - - - false - - tool/fragments/ce/common/import_save.jmx - - - - Import successfully done - - Assertion.response_data - false - 16 - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${apiImportProductsPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "API Import Products"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - groovy - - - true - def fileAsBase64 = new File("${files_folder}${adminImportProductFilePath}").bytes.encodeBase64().toString() -vars.put("importProductsFileToBase64", fileAsBase64) - tool/fragments/ce/api/import_products_file_to_base64.jmx - - - - true - - - - false - {"source":{"entity":"catalog_product", "behavior":"append","validationStrategy": "validation-stop-on-errors", "allowedErrorCount":"10","csvData":"${importProductsFileToBase64}"}} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}/rest/default/V1/import/csv - POST - true - false - true - false - false - - tool/fragments/ce/api/import_products.jmx - - - - - Entities Processed\: 1000\"\] - - Assertion.response_data - false - 2 - - - - - - - - 1 - false - 1 - ${apiSinglePercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "API"); - - true - - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - 1 - false - 1 - 100 - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "API Process Orders"); - - true - - - - - // 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; - } - - threadNum = ${__threadNum}; - vars.put("ordersPerThread", String.valueOf(ordersPerThread)); - vars.put("threadNum", String.valueOf(threadNum)); - - - - - false - tool/fragments/ce/api/process_orders/setup.jmx - - - - - - - true - status - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - true - Pending - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - true - ${ordersPerThread} - = - true - searchCriteria[pageSize] - - - true - ${threadNum} - = - true - searchCriteria[current_page] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/orders - GET - true - false - true - false - false - - tool/fragments/ce/api/process_orders/get_orders.jmx - - - entity_ids - $.items[*].entity_id - - - BODY - - - - - - entity_ids - order_id - true - tool/fragments/ce/api/process_orders/for_each_order.jmx - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/order/${order_id}/invoice - POST - true - false - true - false - false - - tool/fragments/ce/api/process_orders/create_invoice.jmx - - - - "\d+" - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/order/${order_id}/ship - POST - true - false - true - false - false - - tool/fragments/ce/api/process_orders/create_shipment.jmx - - - - "\d+" - - Assertion.response_data - false - 2 - - - - - - - - - 1 - false - 1 - 100 - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "API Product Attribute Management"); - - true - - - - - true - - - - false - { - "attributeSet": { - "attribute_set_name": "new_attribute_set_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "sort_order": 500 - }, - "skeletonId": "4" -} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/attribute-sets/ - POST - true - false - true - false - false - - tool/fragments/ce/api/create_attribute_set.jmx - - - attribute_set_id - $.attribute_set_id - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - attribute_set_id - - - - - - true - - - - false - { - "group": { - "attribute_group_name": "empty_attribute_group_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "attribute_set_id": ${attribute_set_id} - } -} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/attribute-sets/groups - POST - true - false - true - false - false - - tool/fragments/ce/api/create_attribute_group.jmx - - - attribute_group_id - $.attribute_group_id - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - attribute_set_id - - - - - - true - - - - false - { - "attribute": { - "attribute_code": "attr_code_${__time()}", - "frontend_labels": [ - { - "store_id": 0, - "label": "front_lbl_${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)}" - } - ], - "default_value": "default value", - "frontend_input": "textarea", - "is_required": 1 - } -} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/attributes/ - POST - true - false - true - false - false - - tool/fragments/ce/api/create_attribute.jmx - - - attribute_id - $.attribute_id - - - BODY - - - - attribute_code - $.attribute_code - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - attribute_id - - - - - ^[a-z0-9-_]+$ - - Assertion.response_data - false - 1 - variable - attribute_code - - - - - - true - - - - false - { - "attributeSetId": "${attribute_set_id}", - "attributeGroupId": "${attribute_group_id}", - "attributeCode": "${attribute_code}", - "sortOrder": 3 -} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/default/V1/products/attribute-sets/attributes - POST - true - false - true - false - false - - tool/fragments/ce/api/add_attribute_to_attribute_set.jmx - - - $ - (\d+) - true - false - false - - - - - - - - - - 1 - false - 1 - ${adminCategoryManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Admin Category Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_category_management/admin_category_management.jmx - - - - javascript - - - - random = new java.util.Random(); -if (${seedForRandom} > 0) { -random.setSeed(${seedForRandom} + ${__threadNum}); -} - -/** - * Get unique ids for fix concurrent category saving - */ -function getNextProductNumber(i) { - number = productsVariationsSize * ${__threadNum} - i; - if (number >= productsSize) { - log.info("${testLabel}: capacity of product list is not enough for support all ${adminPoolUsers} threads"); - return random.nextInt(productsSize); - } - return productsVariationsSize * ${__threadNum} - i; -} - -var productsVariationsSize = 5, - productsSize = props.get("simple_products_list_for_edit").size(); - - -for (i = 1; i<= productsVariationsSize; i++) { - var productVariablePrefix = "simple_product_" + i + "_"; - number = getNextProductNumber(i); - simpleList = props.get("simple_products_list_for_edit").get(number); - - vars.put(productVariablePrefix + "url_key", simpleList.get("url_key")); - vars.put(productVariablePrefix + "id", simpleList.get("id")); - vars.put(productVariablePrefix + "name", simpleList.get("title")); -} - -categoryIndex = random.nextInt(props.get("admin_category_ids_list").size()); -vars.put("parent_category_id", props.get("admin_category_ids_list").get(categoryIndex)); -do { -categoryIndexNew = random.nextInt(props.get("admin_category_ids_list").size()); -} while(categoryIndex == categoryIndexNew); -vars.put("new_parent_category_id", props.get("admin_category_ids_list").get(categoryIndexNew)); - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/edit/id/${parent_category_id}/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/add/store/0/parent/${parent_category_id} - GET - true - false - true - false - false - - - - - - <title>New Category - - Assertion.response_data - false - 2 - - - - - - - - true - - = - true - id - - - true - ${parent_category_id} - = - true - parent - - - true - - = - true - path - - - true - - = - true - store_id - - - true - 0 - = - true - is_active - - - true - 0 - = - true - include_in_menu - - - true - 1 - = - true - is_anchor - - - true - true - = - true - use_config[available_sort_by] - - - true - true - = - true - use_config[default_sort_by] - - - true - true - = - true - use_config[filter_price_range] - - - true - false - = - true - use_default[url_key] - - - true - 0 - = - true - url_key_create_redirect - - - true - 0 - = - true - custom_use_parent_settings - - - true - 0 - = - true - custom_apply_to_products - - - true - Admin Category Management ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - name - - - true - admin-category-management-${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - url_key - - - true - - = - true - meta_title - - - true - - = - true - description - - - true - PRODUCTS - = - true - display_mode - - - true - position - = - true - default_sort_by - - - true - - = - true - meta_keywords - - - true - - = - true - meta_description - - - true - - = - true - custom_layout_update - - - false - {"${simple_product_1_id}":"","${simple_product_2_id}":"","${simple_product_3_id}":"","${simple_product_4_id}":"","${simple_product_5_id}":""} - = - true - category_products - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/save/ - POST - true - false - true - false - false - - - - - URL - admin_category_id - /catalog/category/edit/id/(\d+)/ - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_id - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/edit/id/${admin_category_id}/ - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - false - admin_category_entity_id - "entity_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_attribute_set_id - "attribute_set_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_parent_id - "parent_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_created_at - "created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_updated_at - "updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_path - "entity_id":(.+)"path":"([^\"]+)" - $2$ - - 1 - - - - false - admin_category_level - "level":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_name - "entity_id":(.+)"name":"([^"]+)" - $2$ - - 1 - - - - false - admin_category_url_key - "url_key":"([^"]+)" - $1$ - - 1 - - - - false - admin_category_url_path - "url_path":"([^"]+)" - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_entity_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_attribute_set_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_parent_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_updated_at - - - - - ^[\d\\\/]+$ - - Assertion.response_data - false - 1 - variable - admin_category_path - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_category_level - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_name - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_url_key - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_category_url_path - - - - - ${simple_product_1_name} - ${simple_product_2_name} - ${simple_product_3_name} - ${simple_product_4_name} - ${simple_product_5_name} - - Assertion.response_data - false - 2 - - - - - - - - true - ${admin_category_id} - = - true - id - - - true - ${admin_form_key} - = - true - form_key - - - true - append - = - true - point - - - true - ${new_parent_category_id} - = - true - pid - - - true - ${parent_category_id} - = - true - paid - - - true - 0 - = - true - aid - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/move/ - POST - true - false - true - false - false - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/catalog/category/delete/id/${admin_category_id}/ - POST - true - false - true - false - false - - - - - - You deleted the category. - - Assertion.response_data - false - 2 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCategoryManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${adminPromotionRulesPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Admin Promotion Rules"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_promotions_management/admin_promotions_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/ - GET - true - false - true - false - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/new - GET - true - false - true - false - false - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - true - - - true - 1--1 - = - true - id - - - true - Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal - = - true - type - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/newConditionHtml/form/sales_rule_formrule_conditions_fieldset_/form_namespace/sales_rule_form - POST - true - false - true - false - false - - - - - - - - true - Rule Name ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - name - - - true - 0 - = - true - is_active - - - true - 0 - = - true - use_auto_generation - - - true - 1 - = - true - is_rss - - - true - 0 - = - true - apply_to_shipping - - - true - 0 - = - true - stop_rules_processing - - - true - - = - true - coupon_code - - - true - - = - true - uses_per_coupon - - - true - - = - true - uses_per_customer - - - true - - = - true - sort_order - - - true - 5 - = - true - discount_amount - - - true - 0 - = - true - discount_qty - - - true - - = - true - discount_step - - - true - - = - true - reward_points_delta - - - true - - = - true - store_labels[0] - - - true - Rule Description ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - description - - - true - 1 - = - true - coupon_type - - - true - cart_fixed - = - true - simple_action - - - true - 1 - = - true - website_ids[0] - - - true - 0 - = - true - customer_group_ids[0] - - - true - - = - true - from_date - - - true - - = - true - to_date - - - true - Magento\SalesRule\Model\Rule\Condition\Combine - = - true - rule[conditions][1][type] - - - true - all - = - true - rule[conditions][1][aggregator] - - - true - 1 - = - true - rule[conditions][1][value] - - - true - Magento\SalesRule\Model\Rule\Condition\Address - = - true - rule[conditions][1--1][type] - - - true - base_subtotal - = - true - rule[conditions][1--1][attribute] - - - true - >= - = - true - rule[conditions][1--1][operator] - - - true - 100 - = - true - rule[conditions][1--1][value] - - - true - - = - true - rule[conditions][1][new_chlid] - - - true - Magento\SalesRule\Model\Rule\Condition\Product\Combine - = - true - rule[actions][1][type] - - - true - all - = - true - rule[actions][1][aggregator] - - - true - 1 - = - true - rule[actions][1][value] - - - true - - = - true - rule[actions][1][new_child] - - - true - - = - true - store_labels[1] - - - true - - = - true - store_labels[2] - - - true - - = - true - related_banners - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales_rule/promo_quote/save/ - POST - true - false - true - false - false - - - - - - You saved the rule. - - Assertion.response_data - false - 16 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminPromotionsManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${adminCustomerManagementPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Admin Customer Management"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ce/admin_customer_management/admin_customer_management.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index - GET - true - false - true - false - false - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - true - customer_listing - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 20 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - - - true - customer_listing - = - true - namespace - - - true - Lastname - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 20 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - false - customer_edit_url_path - actions":\{"edit":\{"href":"(?:http|https):\\/\\/(.*?)\\/customer\\/index\\/edit\\/id\\/(\d+)\\/", - /customer/index/edit/id/$2$/ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - customer_edit_url_path - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}${customer_edit_url_path} - GET - true - false - true - false - false - - - - - - Customer Information - - Assertion.response_data - false - 2 - - - - false - admin_customer_entity_id - "entity_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_website_id - "website_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_firstname - "firstname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_lastname - "lastname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_email - "email":"([^\@]+@[^.]+.[^"]+)" - $1$ - - 1 - - - - false - admin_customer_group_id - "group_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_store_id - "store_id":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_created_at - "created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_updated_at - "updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_is_active - "is_active":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_disable_auto_group_change - "disable_auto_group_change":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_created_in - "created_in":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_dob - "dob":"(\d+)-(\d+)-(\d+)" - $2$/$3$/$1$ - - 1 - - - - false - admin_customer_default_billing - "default_billing":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_default_shipping - "default_shipping":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_gender - "gender":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_failures_num - "failures_num":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_address_entity_id - _address":\{"entity_id":"(\d+)".+?"parent_id":"${admin_customer_entity_id}" - $1$ - - 1 - - - - false - admin_customer_address_created_at - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"created_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_updated_at - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"updated_at":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_is_active - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"is_active":"(\d+)" - $1$ - - 1 - - - - false - admin_customer_address_city - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"city":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_country_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"country_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_firstname - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"firstname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_lastname - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"lastname":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_postcode - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"postcode":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_region - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_region_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"region_id":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_street - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"street":\["([^"]+)"\] - $1$ - - 1 - - - - false - admin_customer_address_telephone - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"telephone":"([^"]+)" - $1$ - - 1 - - - - false - admin_customer_address_customer_id - _address":\{.+?"parent_id":"${admin_customer_entity_id}".+?"customer_id":"([^"]+)" - $1$ - - 1 - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_entity_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_website_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_firstname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_lastname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_email - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_group_id - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_store_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_updated_at - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_is_active - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_disable_auto_group_change - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_created_in - - - - - ^\d+/\d+/\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_dob - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_default_billing - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_default_shipping - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_gender - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_failures_num - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_entity_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_created_at - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_updated_at - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_is_active - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_city - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_country_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_firstname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_lastname - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_postcode - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_region - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_region_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_street - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_telephone - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - admin_customer_address_customer_id - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_customer_entity_id} - = - true - customer[entity_id] - - - true - ${admin_customer_website_id} - = - true - customer[website_id] - - - true - ${admin_customer_email} - = - true - customer[email] - - - true - ${admin_customer_group_id} - = - true - customer[group_id] - - - true - ${admin_customer_store_id} - = - true - customer[store_id] - - - true - ${admin_customer_created_at} - = - true - customer[created_at] - - - true - ${admin_customer_updated_at} - = - true - customer[updated_at] - - - true - ${admin_customer_is_active} - = - true - customer[is_active] - - - true - ${admin_customer_disable_auto_group_change} - = - true - customer[disable_auto_group_change] - - - true - ${admin_customer_created_in} - = - true - customer[created_in] - - - true - - = - true - customer[prefix] - - - true - ${admin_customer_firstname} 1 - = - true - customer[firstname] - - - true - - = - true - customer[middlename] - - - true - ${admin_customer_lastname} 1 - = - true - customer[lastname] - - - true - - = - true - customer[suffix] - - - true - ${admin_customer_dob} - = - true - customer[dob] - - - true - ${admin_customer_default_billing} - = - true - customer[default_billing] - - - true - ${admin_customer_default_shipping} - = - true - customer[default_shipping] - - - true - - = - true - customer[taxvat] - - - true - ${admin_customer_gender} - = - true - customer[gender] - - - true - ${admin_customer_failures_num} - = - true - customer[failures_num] - - - true - ${admin_customer_store_id} - = - true - customer[sendemail_store_id] - - - true - ${admin_customer_address_entity_id} - = - true - address[${admin_customer_address_entity_id}][entity_id] - - - true - ${admin_customer_address_created_at} - = - true - address[${admin_customer_address_entity_id}][created_at] - - - true - ${admin_customer_address_updated_at} - = - true - address[${admin_customer_address_entity_id}][updated_at] - - - true - ${admin_customer_address_is_active} - = - true - address[${admin_customer_address_entity_id}][is_active] - - - true - ${admin_customer_address_city} - = - true - address[${admin_customer_address_entity_id}][city] - - - true - - = - true - address[${admin_customer_address_entity_id}][company] - - - true - ${admin_customer_address_country_id} - = - true - address[${admin_customer_address_entity_id}][country_id] - - - true - ${admin_customer_address_firstname} - = - true - address[${admin_customer_address_entity_id}][firstname] - - - true - ${admin_customer_address_lastname} - = - true - address[${admin_customer_address_entity_id}][lastname] - - - true - - = - true - address[${admin_customer_address_entity_id}][middlename] - - - true - ${admin_customer_address_postcode} - = - true - address[${admin_customer_address_entity_id}][postcode] - - - true - - = - true - address[${admin_customer_address_entity_id}][prefix] - - - true - ${admin_customer_address_region} - = - true - address[${admin_customer_address_entity_id}][region] - - - true - ${admin_customer_address_region_id} - = - true - address[${admin_customer_address_entity_id}][region_id] - - - true - ${admin_customer_address_street} - = - true - address[${admin_customer_address_entity_id}][street][0] - - - true - - = - true - address[${admin_customer_address_entity_id}][street][1] - - - true - - = - true - address[${admin_customer_address_entity_id}][suffix] - - - true - ${admin_customer_address_telephone} - = - true - address[${admin_customer_address_entity_id}][telephone] - - - true - - = - true - address[${admin_customer_address_entity_id}][vat_id] - - - true - ${admin_customer_address_customer_id} - = - true - address[${admin_customer_address_entity_id}][customer_id] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_billing] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_shipping] - - - true - - = - true - address[new_0][prefix] - - - true - John - = - true - address[new_0][firstname] - - - true - - = - true - address[new_0][middlename] - - - true - Doe - = - true - address[new_0][lastname] - - - true - - = - true - address[new_0][suffix] - - - true - Test Company - = - true - address[new_0][company] - - - true - Folsom - = - true - address[new_0][city] - - - true - 95630 - = - true - address[new_0][postcode] - - - true - 1234567890 - = - true - address[new_0][telephone] - - - true - - = - true - address[new_0][vat_id] - - - true - false - = - true - address[new_0][default_billing] - - - true - false - = - true - address[new_0][default_shipping] - - - true - 123 Main - = - true - address[new_0][street][0] - - - true - - = - true - address[new_0][street][1] - - - true - - = - true - address[new_0][region] - - - true - US - = - true - address[new_0][country_id] - - - true - ${admin_customer_address_region_id} - = - true - address[new_0][region_id] - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index/validate/ - POST - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 16 - - - - - - - - true - true - = - true - isAjax - - - true - ${admin_customer_entity_id} - = - true - customer[entity_id] - - - true - ${admin_customer_website_id} - = - true - customer[website_id] - - - true - ${admin_customer_email} - = - true - customer[email] - - - true - ${admin_customer_group_id} - = - true - customer[group_id] - - - true - ${admin_customer_store_id} - = - true - customer[store_id] - - - true - ${admin_customer_created_at} - = - true - customer[created_at] - - - true - ${admin_customer_updated_at} - = - true - customer[updated_at] - - - true - ${admin_customer_is_active} - = - true - customer[is_active] - - - true - ${admin_customer_disable_auto_group_change} - = - true - customer[disable_auto_group_change] - - - true - ${admin_customer_created_in} - = - true - customer[created_in] - - - true - - = - true - customer[prefix] - - - true - ${admin_customer_firstname} 1 - = - true - customer[firstname] - - - true - - = - true - customer[middlename] - - - true - ${admin_customer_lastname} 1 - = - true - customer[lastname] - - - true - - = - true - customer[suffix] - - - true - ${admin_customer_dob} - = - true - customer[dob] - - - true - ${admin_customer_default_billing} - = - true - customer[default_billing] - - - true - ${admin_customer_default_shipping} - = - true - customer[default_shipping] - - - true - - = - true - customer[taxvat] - - - true - ${admin_customer_gender} - = - true - customer[gender] - - - true - ${admin_customer_failures_num} - = - true - customer[failures_num] - - - true - ${admin_customer_store_id} - = - true - customer[sendemail_store_id] - - - true - ${admin_customer_address_entity_id} - = - true - address[${admin_customer_address_entity_id}][entity_id] - - - - true - ${admin_customer_address_created_at} - = - true - address[${admin_customer_address_entity_id}][created_at] - - - true - ${admin_customer_address_updated_at} - = - true - address[${admin_customer_address_entity_id}][updated_at] - - - true - ${admin_customer_address_is_active} - = - true - address[${admin_customer_address_entity_id}][is_active] - - - true - ${admin_customer_address_city} - = - true - address[${admin_customer_address_entity_id}][city] - - - true - - = - true - address[${admin_customer_address_entity_id}][company] - - - true - ${admin_customer_address_country_id} - = - true - address[${admin_customer_address_entity_id}][country_id] - - - true - ${admin_customer_address_firstname} - = - true - address[${admin_customer_address_entity_id}][firstname] - - - true - ${admin_customer_address_lastname} - = - true - address[${admin_customer_address_entity_id}][lastname] - - - true - - = - true - address[${admin_customer_address_entity_id}][middlename] - - - true - ${admin_customer_address_postcode} - = - true - address[${admin_customer_address_entity_id}][postcode] - - - true - - = - true - address[${admin_customer_address_entity_id}][prefix] - - - true - ${admin_customer_address_region} - = - true - address[${admin_customer_address_entity_id}][region] - - - true - ${admin_customer_address_region_id} - = - true - address[${admin_customer_address_entity_id}][region_id] - - - true - ${admin_customer_address_street} - = - true - address[${admin_customer_address_entity_id}][street][0] - - - true - - = - true - address[${admin_customer_address_entity_id}][street][1] - - - true - - = - true - address[${admin_customer_address_entity_id}][suffix] - - - true - ${admin_customer_address_telephone} - = - true - address[${admin_customer_address_entity_id}][telephone] - - - true - - = - true - address[${admin_customer_address_entity_id}][vat_id] - - - true - ${admin_customer_address_customer_id} - = - true - address[${admin_customer_address_entity_id}][customer_id] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_billing] - - - true - true - = - true - address[${admin_customer_address_entity_id}][default_shipping] - - - true - - = - true - address[new_0][prefix] - - - true - John - = - true - address[new_0][firstname] - - - true - - = - true - address[new_0][middlename] - - - true - Doe - = - true - address[new_0][lastname] - - - true - - = - true - address[new_0][suffix] - - - true - Test Company - = - true - address[new_0][company] - - - true - Folsom - = - true - address[new_0][city] - - - true - 95630 - = - true - address[new_0][postcode] - - - true - 1234567890 - = - true - address[new_0][telephone] - - - true - - = - true - address[new_0][vat_id] - - - true - false - = - true - address[new_0][default_billing] - - - true - false - = - true - address[new_0][default_shipping] - - - true - 123 Main - = - true - address[new_0][street][0] - - - true - - = - true - address[new_0][street][1] - - - true - - = - true - address[new_0][region] - - - true - US - = - true - address[new_0][country_id] - - - true - 12 - = - true - address[new_0][region_id] - - - true - ${admin_form_key} - = - true - form_key - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/customer/index/save/ - POST - true - false - true - true - false - - - - - - You saved the customer. - - Assertion.response_data - false - 2 - - - - - 1 - 0 - ${__javaScript(Math.round(${adminCustomerManagementDelay}*1000))} - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${adminEditOrderPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Admin Edit Order"); - - true - - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/orders_page.jmx - - - - Create New Order - - Assertion.response_data - false - 2 - - - - - - - - - true - sales_order_grid - = - true - namespace - - - true - - = - true - search - - - true - true - = - true - filters[placeholder] - - - true - 200 - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - increment_id - = - true - sorting[field] - - - true - desc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - true - ${admin_form_key} - = - true - form_key - false - - - true - pending - = - true - filters[status] - true - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - sales_order_grid - = - true - namespace - true - - - true - - = - true - search - true - - - true - true - = - true - filters[placeholder] - true - - - true - 200 - = - true - paging[pageSize] - true - - - true - 1 - = - true - paging[current] - true - - - true - increment_id - = - true - sorting[field] - true - - - true - asc - = - true - sorting[direction] - true - - - true - true - = - true - isAjax - true - - - true - pending - = - true - filters[status] - - - true - ${__time()}${__Random(1,1000000)} - = - true - _ - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/search_orders.jmx - - - - totalRecords - - Assertion.response_data - false - 2 - - - - false - order_numbers - \"increment_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - false - order_ids - \"entity_id\":\"(\d+)\"\, - $1$ - - -1 - simple_products - - - - - - tool/fragments/ce/admin_create_process_returns/setup.jmx - - import java.util.ArrayList; - import java.util.HashMap; - import org.apache.jmeter.protocol.http.util.Base64Encoder; - import java.util.Random; - - // get count of "order_numbers" variable defined in "Search Pending Orders Limit" - int ordersCount = Integer.parseInt(vars.get("order_numbers_matchNr")); - - - int clusterLength; - int threadsNumber = ctx.getThreadGroup().getNumThreads(); - if (threadsNumber == 0) { - //Number of orders for one thread - clusterLength = ordersCount; - } else { - clusterLength = Math.round(ordersCount / threadsNumber); - if (clusterLength == 0) { - clusterLength = 1; - } - } - - //Current thread number starts from 0 - int currentThreadNum = ctx.getThreadNum(); - - //Index of the current product from the cluster - Random random = new Random(); - if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); - } - int iterator = random.nextInt(clusterLength); - if (iterator == 0) { - iterator = 1; - } - - int i = clusterLength * currentThreadNum + iterator; - - orderNumber = vars.get("order_numbers_" + i.toString()); - orderId = vars.get("order_ids_" + i.toString()); - vars.put("order_number", orderNumber); - vars.put("order_id", orderId); - - - - - false - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/view/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/open_order.jmx - - - - #${order_number} - - Assertion.response_data - false - 2 - - - - false - order_status - <span id="order_status">([^<]+)</span> - $1$ - - 1 - simple_products - - - - - - "${order_status}" == "Pending" - false - tool/fragments/ce/admin_edit_order/if_controller.jmx - - - - - - true - pending - = - true - history[status] - false - - - true - Some text - = - true - history[comment] - - - true - ${admin_form_key} - = - true - form_key - false - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order/addComment/order_id/${order_id}/?isAjax=true - POST - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/add_comment.jmx - - - - Not Notified - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_start.jmx - - - - Invoice Totals - - Assertion.response_data - false - 2 - - - - false - item_ids - <div id="order_item_(\d+)_title"\s*class="product-title"> - $1$ - - -1 - simple_products - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - invoice[items][${item_ids_1}] - - - true - 1 - = - true - invoice[items][${item_ids_2}] - - - true - Invoiced - = - true - invoice[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/sales/order_invoice/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_create_process_returns/invoice_submit.jmx - - - - The invoice has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/start/order_id/${order_id}/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/shipment_start.jmx - - - - New Shipment - - Assertion.response_data - false - 2 - - - - - - - - - true - ${admin_form_key} - = - true - form_key - false - - - true - 1 - = - true - shipment[items][${item_ids_1}] - - - true - 1 - = - true - shipment[items][${item_ids_2}] - - - true - Shipped - = - true - shipment[comment_text] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/order_shipment/save/order_id/${order_id}/ - POST - true - false - true - false - false - - tool/fragments/ce/admin_edit_order/shipment_submit.jmx - - - - The shipment has been created - - Assertion.response_data - false - 2 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - - - 1 - false - 1 - ${catalogGraphQLPercentage} - tool/fragments/_system/scenario_controller_tmpl.jmx - - - -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 = "" - } - - - - javascript - tool/fragments/_system/setup_label.jmx - - - - vars.put("testLabel", "Catalog GraphQL"); - - true - - - - - tool/fragments/ce/once_only_controller.jmx - - - - - function getFormKeyFromResponse() - { - var url = prev.getUrlAsString(), - responseCode = prev.getResponseCode(), - formKey = null; - searchPattern = /var FORM_KEY = '(.+)'/; - if (responseCode == "200" && url) { - response = prev.getResponseDataAsString(); - formKey = response && response.match(searchPattern) ? response.match(searchPattern)[1] : null; - } - return formKey; - } - - formKey = vars.get("form_key_storage"); - - currentFormKey = getFormKeyFromResponse(); - - if (currentFormKey != null && currentFormKey != formKey) { - vars.put("form_key_storage", currentFormKey); - } - - javascript - tool/fragments/ce/admin/handle_admin_form_key.jmx - - - - formKey = vars.get("form_key_storage"); - if (formKey - && sampler.getClass().getName() == 'org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy' - && sampler.getMethod() == "POST") - { - arguments = sampler.getArguments(); - for (i=0; i<arguments.getArgumentCount(); i++) - { - argument = arguments.getArgument(i); - if (argument.getName() == 'form_key' && argument.getValue() != formKey) { - log.info("admin form key updated: " + argument.getValue() + " => " + formKey); - argument.setValue(formKey); - } - } - } - - javascript - - - - - - false - tool/fragments/ce/http_cookie_manager_without_clear_each_iteration.jmx - - - - tool/fragments/ce/simple_controller.jmx - - - - get-admin-email - tool/fragments/ce/lock_controller.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")); - -if (adminUsersDistribution == 1) { - adminUser = adminUserList.poll(); -} else { - if (!adminUserListIterator.hasNext()) { - adminUserListIterator = adminUserList.descendingIterator(); - } - - adminUser = adminUserListIterator.next(); -} - -if (adminUser == "none") { - SampleResult.setResponseMessage("adminUser list is empty"); - SampleResult.setResponseData("adminUser list is empty","UTF-8"); - IsSuccess=false; - SampleResult.setSuccessful(false); - SampleResult.setStopThread(true); -} -vars.put("admin_user", adminUser); - - - - true - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/ - GET - true - false - true - false - false - - tool/fragments/ce/admin_login/admin_login.jmx - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - - true - - = - true - dummy - - - true - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - tool/fragments/ce/admin_login/admin_login_submit_form.jmx - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - tool/fragments/ce/admin_login/admin_retrieve_form_key.jmx - - - - - - tool/fragments/ce/simple_controller.jmx - - - - tool/fragments/ee/admin_create_cms_page_with_page_builder_product_list/admin_create_cms_page_with_page_builder_product_list.jmx - - - - - - - - - ${request_protocol} - - ${base_path}${admin_path}/cms/page/new - GET - true - false - true - false - - 60000 - 200000 - - - - - - - true - <div data-content-type="row" data-appearance="contained" data-element="main"><div data-enable-parallax="0" data-parallax-speed="0.5" data-background-images="{}" data-element="inner" style="justify-content: flex-start; display: flex; flex-direction: column; background-position: left top; background-size: cover; background-repeat: no-repeat; background-attachment: scroll; border-style: none; border-width: 1px; border-radius: 0px; margin: 0px 0px 10px; padding: 10px;"><div data-content-type="products" data-appearance="grid" data-element="main" style="border-style: none; border-width: 1px; border-radius: 0px; margin: 0px; padding: 0px;">{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" template="Magento_CatalogWidget::product/widget/content/grid.phtml" anchor_text="" id_path="" show_pager="0" products_count="5" sort_order="date_newest_top" type_name="Catalog Products List" conditions_encoded="^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`aggregator`:`any`,`value`:`1`,`new_child`:``^]^]"}}</div></div></div> - = - true - content - - - true - - = - true - content_heading - - - true - ${admin_form_key} - = - true - form_key - - - true - - = - true - identifier - - - true - 1 - = - true - is_active - - - true - - = - true - layout_update_xml - - - true - - = - true - meta_description - - - true - - = - true - meta_keywords - - - true - - = - true - meta_title - - - false - {} - = - true - nodes_data - - - true - - = - true - node_ids - - - true - - = - true - page_id - - - true - 1column - = - true - page_layout - - - true - 0 - = - true - store_id[0] - - - true - Page Builder Products ${__time(YMDHMS)}-${__threadNum}-${__Random(1,1000000)} - = - true - title - - - true - 0 - = - true - website_root - - - - - - ${request_protocol} - - ${base_path}${admin_path}/cms/page/save/back/edit - POST - true - false - true - false - - 60000 - 200000 - - - - - You saved the page. - - Assertion.response_data - false - 16 - - - - URL - cms_page_id - /page_id\/([0-9]*)\/back/ - $1$ - - 1 - - - - - - - - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}${admin_path}/admin/auth/logout/ - GET - true - false - true - false - false - - tool/fragments/ce/setup/admin_logout.jmx - - - - false - - - - adminUsersDistribution = Integer.parseInt(vars.get("admin_users_distribution_per_admin_pool")); - if (adminUsersDistribution == 1) { - adminUserList = props.get("adminUserList"); - adminUserList.add(vars.get("admin_user")); - } - - tool/fragments/ce/common/return_admin_email_to_pool.jmx - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - tool/fragments/ce/common/init_random_generator_setup.jmx - -import java.util.Random; - -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom} + ${__threadNum}); -} - -vars.putObject("randomIntGenerator", random); - - - - true - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - tool/fragments/ce/graphql/simple_products_setup.jmx - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("simple_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("simple_product_id", product.get("id")); -vars.put("simple_product_sku", product.get("sku")); - - - - true - - - - - tool/fragments/ce/graphql/configurable_products_setup.jmx - -import java.util.Random; - -Random random = vars.getObject("randomIntGenerator"); -number = random.nextInt(props.get("configurable_products_list").size()); -product = props.get("simple_products_list").get(number); - -vars.put("configurable_product_id", product.get("id")); -vars.put("configurable_product_sku", product.get("sku")); - - - - true - - - - - - - tool/fragments/ce/simple_controller.jmx - - - - - - Content-Type - application/json - - - Accept - */* - - - tool/fragments/ce/api/header_manager_before_token.jmx - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - tool/fragments/ce/api/admin_token_retrieval.jmx - - - admin_token - $ - - - BODY - - - - - ^.{10,}$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - - Authorization - Bearer ${admin_token} - - - tool/fragments/ce/api/header_manager.jmx - - - - true - - - - false - {"query":"{\n products(\n filter: {\n price: {from: \"5\"}\n name:{match:\"Product\"}\n }\n pageSize: 20\n currentPage: 1\n sort: {\n price: ASC\n name:DESC\n }\n ) {\n total_count\n items {\n attribute_set_id\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n short_description {\n html\n }\n sku\n small_image {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n \t... on PhysicalProductInterface {\n \tweight\n \t}\n }\n page_info {\n page_size\n current_page\n }\n }\n}\n","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_filter_only.jmx - - - - graphql_multiple_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_multiple_products_query_total_count"); - if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; - } else { - if (Integer.parseInt(totalCount) < 200) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than 200, Actual: " + totalCount; - } else { - Failure = false; - } - } - - - - false - - - - - - true - - - - false - {"query":"{\n products(filter: {sku: { eq: \"${simple_product_sku}\" } },sort: {name: ASC})\n {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t }\n }\n }\n}\n","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_simple_product_with_extensible_data_objects.jmx - - - - graphql_simple_products_query_total_count - $.data.products.total_count - - - BODY - - - - - graphql_multiple_products_query_response - $ - - - BODY - - - - String totalCount=vars.get("graphql_simple_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) != 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be equal to 1, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - false - - - - $.data.products.items[0].sku - ${simple_product_sku} - true - false - false - true - - - - - - true - - - - false - {"query":"{\n products(filter: {sku: {eq:\"${configurable_product_sku}\"} }, sort: {name: ASC}) {\n total_count\n items {\n ... on PhysicalProductInterface {\n weight\n }\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_configurable_product_with_extensible_data_objects.jmx - - - - graphql_configurable_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_configurable_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) != 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be equal to 1, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - $.data.products.items[0].sku - ${configurable_product_sku} - true - false - false - true - - - - - - true - - - - false - {"query":"{\n products(\n pageSize:20\n currentPage:1\n search: \"configurable\"\n filter: {name: {match: \"Configurable Product\"} }\n sort: {name: ASC}\n ) {\n total_count\n page_info {\n current_page\n page_size\n total_pages\n }\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t\t}\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter.jmx - - - - graphql_search_products_query_total_count_fulltext_filter - $.data.products.total_count - - - BODY - - - - graphql_search_products_query_total_pages_fulltext_filter - $.data.products.page_info.total_pages - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count_fulltext_filter"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - - - true - - - - false - {"query":"{\n products(\n pageSize:20\n currentPage:${graphql_search_products_query_total_pages_fulltext_filter}\n search: \"configurable\"\n filter: {name: {match: \"Configurable Product\"} }\n sort: {name: ASC}\n ) {\n total_count\n page_info {\n current_page\n page_size\n total_pages\n }\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t\t}\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter_last_page.jmx - - - - graphql_search_products_query_total_count_fulltext_filter - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count_fulltext_filter"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - - - true - - - - false - {"query":"{\n products(\n pageSize:20\n currentPage:1\n search: \"configurable\"\n sort: {name: ASC}) {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t\t}\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_only.jmx - - - - graphql_search_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - - - true - - - - false - {"query":"{\n products(\n pageSize:20\n currentPage:1\n search: \"Option 1\"\n sort: {name: ASC}) {\n filters {\n name\n filter_items_count\n request_var\n filter_items {\n label\n value_string\n items_count\n ... on SwatchLayerFilterItemInterface {\n swatch_data {\n type\n value\n }\n }\n }\n }\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n weight\n }\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filters.jmx - - - - graphql_search_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count"); - -if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; -} else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } -} - - - - - - false - - - - - - true - - - - false - {"query":"{\n products(\n pageSize:20\n currentPage:1\n search: \"Option 1\"\n sort: {name: ASC}) {\n aggregations{\n attribute_code\n count\n label\n options{\n count\n label\n value\n }\n }\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n weight\n }\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_aggregations.jmx - - - - graphql_search_products_query_total_count - $.data.products.total_count - - - BODY - - - - String totalCount=vars.get("graphql_search_products_query_total_count"); - if (totalCount == null) { - Failure = true; - FailureMessage = "Not Expected \"totalCount\" to be null"; - } else { - if (Integer.parseInt(totalCount) < 1) { - Failure = true; - FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; - } else { - Failure = false; - } - } - - - - false - - - - - - - - true - - - - false - { - "customer": { - - "email": "customer_${__time()}-${__threadNum}-${__Random(1,1000000)}@example.com", - "firstname": "test_${__time()}-${__threadNum}-${__Random(1,1000000)}", - "lastname": "Doe" - }, - "password": "test@123" - } - = - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/customers - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_frontend_customer.jmx - - - - customer_id - $.id - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - customer_id - - - - - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/customers/${customer_id} - GET - true - false - true - false - false - - tool/fragments/ce/api/check_customer.jmx - - - - $.id - ${customer_id} - true - false - false - true - - - - customer_email - $.email - - - BODY - - - - - true - - - - false - { - "username":"${customer_email}", - "password":"test@123" - } - - = - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/integration/customer/token - POST - true - false - true - false - false - - tool/fragments/ce/api/create_customer.jmx - - - - customer_token - $ - - - BODY - - - - - true - - - - false - {"query":"{\n customer {\n created_at\n group_id\n\n prefix\n firstname\n middlename\n lastname\n suffix\n email\n default_billing\n default_shipping\n\n dob\n taxvat\n\n id\n addresses {\n id\n customer_id\n region {\n region_code\n region\n region_id\n }\n region_id\n country_id\n street \n company\n telephone\n fax\n postcode\n city\n firstname\n lastname\n middlename\n prefix\n suffix\n vat_id\n default_shipping\n default_billing\n }\n is_subscribed\n }\n}","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_frontend_customer.jmx - - - - false - - - import org.apache.jmeter.protocol.http.control.Header; - - sampler.getHeaderManager().removeHeaderNamed("Authorization"); - - sampler.getHeaderManager().add(new Header("Authorization","Bearer " + vars.get("customer_token"))); - - - - $.data.customer.lastname - Doe - true - false - false - true - - - - - - - true - - - - false - {"query":"{\n category(id: 1) {\n name\n id\n level\n description\n path\n path_in_store\n url_key\n url_path\n children {\n id\n description\n default_sort_by\n children {\n id\n description\n level\n children {\n level\n id\n children {\n id\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_root_category.jmx - - - - graphql_category_query_name - $.data.category.name - - - BODY - - - - String name = vars.get("graphql_category_query_name"); -if (name == null) { - Failure = true; - FailureMessage = "Not Expected \"children\" to be null"; -} else { - if (!name.equals("Root Catalog")) { - Failure = true; - FailureMessage = "Expected \"name\" to equal \"Root Catalog\", Actual: " + name; - } else { - Failure = false; - } -} - - - - false - - - - - - true - - - - false - {"query":"{\n categoryList{\n name\n id\n level\n description\n path\n path_in_store\n url_key\n url_path\n children {\n id\n description\n default_sort_by\n children {\n id\n description\n level\n children {\n level\n id\n children {\n id\n }\n }\n }\n }\n }\n}","variables":null,"operationName":null} - = - - - - - - - - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/query_root_category_list.jmx - - - - graphql_categoryList_query_name - $.data.categoryList[0].name - - - BODY - JSON - - - - String name = vars.get("graphql_categoryList_query_name"); -if (name == null) { - Failure = true; - FailureMessage = "Not Expected \"children\" to be null"; -} else { - if (!name.equals("Default Category")) { - Failure = true; - FailureMessage = "Expected \"name\" to equal \"Default Category\", Actual: " + name; - } else { - Failure = false; - } -} - - - - false - - - - - - true - - - - false - - {"query":"query getCmsPage($id: Int!, $onServer: Boolean!) {\n cmsPage(id: $id) {\n url_key\n content\n content_heading\n title\n page_layout\n meta_title @include(if: $onServer)\n meta_keywords @include(if: $onServer)\n meta_description @include(if: $onServer)\n }\n}","variables":{"id":${cms_page_id},"onServer":false},"operationName":"getCmsPage"} - - = - - - - - ${graphql_port_number} - 60000 - 200000 - ${request_protocol} - - ${base_path}graphql - POST - true - false - true - false - false - - tool/fragments/ce/graphql/get_get_cms_page_by_id.jmx - - - $.data.cmsPage.url_key - ${cms_page_id} - false - false - false - false - - - - - - - - - - - stoptest - - false - 1 - - 1 - 1 - 1395324075000 - 1395324075000 - false - - - tool/fragments/ce/tear_down.jmx - - - "${dashboard_enabled}" == "1" - false - - - - - - - true - ${__property(environment)} - = - true - environment - - - true - ${start_time} - = - true - startTime - - - true - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - endTime - - - true - ${redis_host} - = - true - stats_server - - - - - - 60000 - 200000 - ${request_protocol} - - ${base_path}DeploymentEvent.php - POST - true - false - true - false - false - - - - - - Errors: - - Assertion.response_data - false - 6 - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - true - - - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - false - false - false - false - false - 0 - true - true - true - true - - - ${response_time_file_name} - tool/fragments/ce/common/aggregate_graph.jmx - - - - false - true - true - false - tool/fragments/_system/debug.jmx - - - - true - - - diff --git a/setup/performance-toolkit/benchmark_2015.jmx b/setup/performance-toolkit/benchmark_2015.jmx deleted file mode 100644 index e58e610304199..0000000000000 --- a/setup/performance-toolkit/benchmark_2015.jmx +++ /dev/null @@ -1,6905 +0,0 @@ - - - - - - - false - false - - - - - request_protocol - ${__P(request_protocol,http)} - = - - - abandonedCartByGuest - ${__P(abandonedCartByGuest,0)} - = - - - abandonedCartByGuestPercent - ${__P(abandonedCartByGuestPercent,100)} - = - - - abandonedCartByCustomer - ${__P(abandonedCartByCustomer,0)} - = - - - abandonedCartByCustomerPercent - ${__P(abandonedCartByCustomerPercent,100)} - = - - - accountManagement - ${__P(accountManagement,0)} - = - - - accountManagementPercent - ${__P(accountManagementPercent,100)} - = - - - admin_password - ${__P(admin_password,123123q)} - = - - - admin_path - ${__P(admin_path,admin)} - = - - - admin_user - ${__P(admin_user,admin)} - = - - - adminBrowseCustomersGridPercent - ${__P(adminBrowseCustomersGridPercent,100)} - = - - - adminBrowseCustomersGridScenario1_ViewOddGridPages - ${__P(adminBrowseCustomersGridScenario1_ViewOddGridPages,0)} - = - - - adminBrowseCustomersGridScenario2_ViewEvenGridPages - ${__P(adminBrowseCustomersGridScenario2_ViewEvenGridPages,0)} - = - - - adminBrowseCustomersGridScenario3_Filtering - ${__P(adminBrowseCustomersGridScenario3_Filtering,0)} - = - - - adminBrowseCustomersGridScenario4_Sorting - ${__P(adminBrowseCustomersGridScenario4_Sorting,0)} - = - - - adminBrowseCustomersGridScenario5_FilteringAndSorting - ${__P(adminBrowseCustomersGridScenario5_FilteringAndSorting,0)} - = - - - adminBrowseOrdersGridPercent - ${__P(adminBrowseOrdersGridPercent,100)} - = - - - adminBrowseOrdersGridScenario1_ViewOddGridPages - ${__P(adminBrowseOrdersGridScenario1_ViewOddGridPages,0)} - = - - - adminBrowseOrdersGridScenario2_ViewEvenGridPages - ${__P(adminBrowseOrdersGridScenario2_ViewEvenGridPages,0)} - = - - - adminBrowseOrdersGridScenario3_Filtering - ${__P(adminBrowseOrdersGridScenario3_Filtering,0)} - = - - - adminBrowseOrdersGridScenario4_Sorting - ${__P(adminBrowseOrdersGridScenario4_Sorting,0)} - = - - - adminBrowseOrdersGridScenario5_FilteringAndSorting - ${__P(adminBrowseOrdersGridScenario5_FilteringAndSorting,0)} - = - - - adminBrowseProductsGridPercent - ${__P(adminBrowseProductsGridPercent,100)} - = - - - adminBrowseProductsGridScenario1_ViewOddGridPages - ${__P(adminBrowseProductsGridScenario1_ViewOddGridPages,0)} - = - - - adminBrowseProductsGridScenario2_ViewEvenGridPages - ${__P(adminBrowseProductsGridScenario2_ViewEvenGridPages,0)} - = - - - adminBrowseProductsGridScenario3_Filtering - ${__P(adminBrowseProductsGridScenario3_Filtering,0)} - = - - - adminBrowseProductsGridScenario4_Sorting - ${__P(adminBrowseProductsGridScenario4_Sorting,0)} - = - - - adminBrowseProductsGridScenario5_FilteringAndSorting - ${__P(adminBrowseProductsGridScenario5_FilteringAndSorting,0)} - = - - - adminCategoryCount - ${__P(adminCategoryCount,0)} - = - - - adminCategoryManagement - ${__P(adminCategoryManagement,0)} - = - - - adminCategoryManagementDelay - ${__P(adminCategoryManagementDelay,0)} - = - - - adminCategoryManagementPercent - ${__P(adminCategoryManagementPercent,100)} - = - - - adminCMSManagement - ${__P(adminCMSManagement,0)} - = - - - adminCMSManagementDelay - ${__P(adminCMSManagementDelay,0)} - = - - - adminCMSManagementPercent - ${__P(adminCMSManagementPercent,100)} - = - - - adminCreateOrder - ${__P(adminCreateOrder,0)} - = - - - adminCreateOrderPercent - ${__P(adminCreateOrderPercent,100)} - = - - - adminCreateProduct - ${__P(adminCreateProduct,0)} - = - - - adminCreateProductPercent - ${__P(adminCreateProductPercent,100)} - = - - - adminCustomerManagement - ${__P(adminCustomerManagement,0)} - = - - - adminCustomerManagementDelay - ${__P(adminCustomerManagementDelay,0)} - = - - - adminCustomerManagementPercent - ${__P(adminCustomerManagementPercent,100)} - = - - - adminEditOrder - ${__P(adminEditOrder,0)} - = - - - adminEditOrderPercent - ${__P(adminEditOrderPercent,100)} - = - - - adminEditProduct - ${__P(adminEditProduct,0)} - = - - - adminEditProductPercent - ${__P(adminEditProductPercent,100)} - = - - - adminExportCustomers - ${__P(adminExportCustomers,0)} - = - - - adminExportProducts - ${__P(adminExportProducts,0)} - = - - - adminImportCustomerBehavior - ${__P(adminImportCustomerBehavior,)} - = - - - adminImportCustomerFilePath - ${__P(adminImportCustomerFilePath,0)} - = - - - adminImportCustomers - ${__P(adminImportCustomers,0)} - = - - - adminImportProductBehavior - ${__P(adminImportProductBehavior,)} - = - - - adminImportProductFilePath - ${__P(adminImportProductFilePath,0)} - = - - - adminImportProductFilePath-2 - ${__P(adminImportProductFilePath-2,0)} - = - - - adminImportProducts - ${__P(adminImportProducts,0)} - = - - - adminPromotionsManagement - ${__P(adminPromotionsManagement,0)} - = - - - adminPromotionsManagementDelay - ${__P(adminPromotionsManagementDelay,0)} - = - - - adminPromotionsManagementPercent - ${__P(adminPromotionsManagementPercent,100)} - = - - - apiBrowseAndBuyFlow - ${__P(apiBrowseAndBuyFlow,0)} - = - - - apiBrowseAndBuyFlowPercent - ${__P(apiBrowseAndBuyFlowPercent,100)} - = - - - apiCustomerSync - ${__P(apiCustomerSync,0)} - = - - - apiCustomerSyncPercent - ${__P(apiCustomerSyncPercent,100)} - = - - - apiOrderInvoiceShipmentSync - ${__P(apiOrderInvoiceShipmentSync,0)} - = - - - apiOrderInvoiceShipmentSyncPercent - ${__P(apiOrderInvoiceShipmentSyncPercent,100)} - = - - - apiProcessOrders - ${__P(apiProcessOrders,0)} - = - - - apiProcessOrdersPercent - ${__P(apiProcessOrdersPercent,100)} - = - - - apiProductSync - ${__P(apiProductSync,0)} - = - - - apiProductSyncPercent - ${__P(apiProductSyncPercent,100)} - = - - - apiSnapshot - ${__P(apiSnapshot,0)} - = - - - bamboo_build_number - ${__P(bamboo_build_number,)} - = - - - base_path - ${__P(base_path,)} - = - - - cache_indicator - ${__P(cache_indicator,0)} - = - - - catalogBrowsingByGuest - ${__P(catalogBrowsingByGuest,0)} - = - - - catalogBrowsingByGuestPercent - ${__P(catalogBrowsingByGuestPercent,100)} - = - - - catalogBrowsingByCustomer - ${__P(catalogBrowsingByCustomer,0)} - = - - - catalogBrowsingByCustomerPercent - ${__P(catalogBrowsingByCustomerPercent,100)} - = - - - categories_count - ${__P(categories_count,100)} - = - - - checkoutByGuest - ${__P(checkoutByGuest,0)} - = - - - checkoutByGuestPercent - ${__P(checkoutByGuestPercent,100)} - = - - - checkoutByCustomer - ${__P(checkoutByCustomer,0)} - = - - - checkoutByCustomerPercent - ${__P(checkoutByCustomerPercent,100)} - = - - - configurable_products_count - ${__P(configurable_products_count,30)} - = - - - customer_checkout_percent - ${__P(customer_checkout_percent,4)} - = - - - customer_limit - ${__P(customer_limit,20)} - = - - - customer_password - 123123q - = - - - customers_page_size - ${__P(customers_page_size,20)} - = - - - dashboard_enabled - ${__P(dashboard_enabled,0)} - = - - - files_folder - ${__P(files_folder,/opt/mpaf/tool/fragments/files/)} - = - - - guest_checkout_percent - ${__P(guest_checkout_percent,4)} - = - - - host - ${__P(host,)} - = - - - loops - ${__P(loops,1)} - = - - - lineItemsAmount - ${__P(lineItemsAmount,10)} - = - - - orders - ${__P(orders,0)} - = - - - orders_page_size - ${__P(orders_page_size,20)} - = - - - products_page_size - ${__P(products_page_size,20)} - = - - - productCompareByGuest - ${__P(productCompareByGuest,0)} - = - - - productCompareByGuestPercent - ${__P(productCompareByGuestPercent,100)} - = - - - productCompareDelay - ${__P(productCompareDelay,0)} - = - - - productsGridMassActions - ${__P(productsGridMassActions,0)} - = - - - productsGridMassActionsPercent - ${__P(productsGridMassActionsPercent,100)} - = - - - ramp_period - ${__P(ramp_period,0)} - = - - - redis_host - ${__P(redis_host,)} - = - - - report_save_path - ${__P(report_save_path,./)} - = - - - response_time_file_name - ${__P(response_time_file_name,production.csv)} - = - - - reviewByCustomer - ${__P(reviewByCustomer,0)} - = - - - reviewByCustomerPercent - ${__P(reviewByCustomerPercent,100)} - = - - - reviewDelay - ${__P(reviewDelay,0)} - = - - - scenario - ${__P(scenario,)} - = - - - seedForRandom - ${__P(seedForRandom,1)} - = - - - searchQuick - ${__P(searchQuick,0)} - = - - - searchQuick_percent - ${__P(searchQuick_percent,100)} - = - - - searchQuickFilter - ${__P(searchQuickFilter,0)} - = - - - searchQuickFilter_percent - ${__P(searchQuickFilter_percent,100)} - = - - - searchAdvanced - ${__P(searchAdvanced,0)} - = - - - searchAdvanced_percent - ${__P(searchAdvanced_percent,100)} - = - - - setupAndTearDownThread - ${__P(setupAndTearDownThread,1)} - = - - - simple_products_count - ${__P(simple_products_count,30)} - = - - - sprint_identifier - ${__P(sprint_identifier,)} - = - - - start_time - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - - - starting_index - ${__P(starting_index,0)} - = - - - test_duration - ${__P(test_duration,900)} - = - - - think_time_deviation - ${__P(think_time_deviation,1000)} - = - - - think_time_delay_offset - ${__P(think_time_delay_offset,2000)} - = - - - url_suffix - .html - = - - - users - ${__P(users,100)} - = - - - view_catalog_percent - ${__P(view_catalog_percent,62)} - = - - - view_product_add_to_cart_percent - ${__P(view_product_add_to_cart_percent,30)} - = - - - website_id - 1 - = - - - wishlistByCustomer - ${__P(wishlistByCustomer,0)} - = - - - wishlistByCustomerPercent - ${__P(wishlistByCustomerPercent,100)} - = - - - wishlistDelay - ${__P(wishlistDelay,0)} - = - - - - - - - - - - ${host} - - - - ${request_protocol} - utf-8 - - Java - 4 - - - - - - - Accept-Language - en-US,en;q=0.5 - - - Accept - application/json,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 - - - User-Agent - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 - - - Accept-Encoding - gzip, deflate - - - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - true - - - - - stoptest - - false - 1 - - ${setupAndTearDownThread} - 1 - 1384333221000 - 1384333221000 - false - - - - - - -props.remove("category_url_key"); -props.remove("category_url_keys_list"); -props.remove("category_name"); -props.remove("category_names_list"); -props.remove("simple_products_list"); -props.remove("configurable_products_list"); -props.remove("users"); -props.remove("customer_emails_list"); - -/* This is only used when admin is enabled. */ -props.put("activeAdminThread", ""); - -/* Set the environment - at this time '01' or '02' */ -String path = "${host}"; -String environment = path.substring(4, 6); -props.put("environment", environment); - - - false - - - - Boolean stopTestOnError (String error) { - log.error(error); - System.out.println(error); - SampleResult.setStopTest(true); - return false; -} - -if ("${host}" == "1") { - return stopTestOnError("\"host\" parameter is not defined. Please define host parameter as: \"-Jhost=example.com\""); -} - -String path = "${base_path}"; -String slash = "/"; -if (!slash.equals(path.substring(path.length() -1)) || !slash.equals(path.substring(0, 1))) { - return stopTestOnError("\"base_path\" parameter is invalid. It must start and end with \"/\""); -} - - - - false - - - - - - - - - - - ${request_protocol} - - ${base_path}${admin_path} - GET - true - false - true - false - false - - - - - - Welcome - <title>Magento Admin</title> - - Assertion.response_data - false - 2 - - - - false - admin_form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - admin_form_key - - - - - - - - false - - = - true - dummy - - - false - ${admin_form_key} - = - true - form_key - - - true - ${admin_password} - = - true - login[password] - - - true - ${admin_user} - = - true - login[username] - - - - - - - - ${request_protocol} - - ${base_path}${admin_path}/admin/dashboard/ - POST - true - false - true - false - Java - false - - Implementation needs to be set to Java as per http://stackoverflow.com/questions/19636282/jmeter-error-in-redirect-url-for-get - - - - - <title>Dashboard / Magento Admin</title> - - Assertion.response_data - false - 2 - - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - types - = - true - massaction_prepare_key - - - true - config,layout,block_html,collections,reflection,db_ddl,eav,config_integration,full_page,target_rule,translate,config_webservice,config_integration_api - = - true - types - - - - - - - - ${request_protocol} - - ${base_path}${admin_path}/admin/cache/massEnable - POST - true - false - true - false - false - - Begin by enabling all cache types - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - types - = - true - massaction_prepare_key - - - true - config,layout,block_html,collections,reflection,db_ddl,eav,config_integration,full_page,target_rule,translate,config_webservice,config_integration_api - = - true - types - - - - - - - - ${request_protocol} - - ${base_path}${admin_path}/admin/cache/massRefresh - POST - true - false - true - false - false - - Refresh all cache types - - - - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^[a-z0-9-]+$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - true - path - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - true - 1/2/% - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - true - like - = - true - searchCriteria[filterGroups][0][filters][0][conditionType] - - - true - level - = - true - searchCriteria[filterGroups][1][filters][0][field] - - - true - 2 - = - true - searchCriteria[filterGroups][1][filters][0][value] - - - true - ${categories_count} - = - true - searchCriteria[pageSize] - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/categories/list - GET - true - false - false - false - false - - - - - false - category_url_keys - url_key\",\"value\":\"(.*?)\" - $1$ - - -1 - - - - false - category_names - name\":\"(.*?)\" - $1$ - - -1 - - - - - - category_url_keys - category_url_key - true - - - - 1 - - 1 - category_url_key_counter - - false - - - - import java.util.ArrayList; - -// If it is first iteration of cycle then recreate category url key list -if (1 == Integer.parseInt(vars.get("category_url_key_counter"))) { - categoryUrlKeysList = new ArrayList(); - props.put("category_url_keys_list", categoryUrlKeysList); - props.put("category_url_key", vars.get("category_url_key")); -} else { - categoryUrlKeysList = props.get("category_url_keys_list"); -} -categoryUrlKeysList.add(vars.get("category_url_key")); - - - false - - - - - category_names - category_name - true - - - - 1 - - 1 - category_name_counter - - false - - - - import java.util.ArrayList; - -// If it is first iteration of cycle then recreate category name list -if (1 == Integer.parseInt(vars.get("category_name_counter"))) { - categoryNamesList = new ArrayList(); - props.put("category_names_list",categoryNamesList); - props.put("category_name", vars.get("category_name")); -} else { - categoryNamesList = props.get("category_names_list"); -} - -categoryNamesList.add(vars.get("category_name")); - - - false - - - - - props.put("category_url_key", vars.get("category_url_key")); -props.put("category_name", vars.get("category_name")); - - - false - - - - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^[a-z0-9-]+$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - true - type_id - = - true - searchCriteria[filterGroups][0][filters][0][field] - - - true - simple - = - true - searchCriteria[filterGroups][0][filters][0][value] - - - true - ${simple_products_count} - = - true - searchCriteria[pageSize] - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/products - GET - true - false - true - false - false - - - - - false - simple_products_url_keys - url_key\",\"value\":\"(.*?)\" - $1$ - - -1 - - - - false - simple_product_ids - \"id\":(\d+), - $1$ - - -1 - - - - false - simple_product_names - name\":\"(.*?)\" - $1$ - - -1 - - - - - - simple_product_ids - simple_product_id - true - - - - 1 - - 1 - simple_products_counter - - false - - - - import java.util.ArrayList; -import java.util.HashMap; -import org.apache.commons.codec.binary.Base64; - -// If it is first iteration of cycle then recreate productList -if (1 == Integer.parseInt(vars.get("simple_products_counter"))) { - productList = new ArrayList(); - props.put("simple_products_list", productList); -} else { - productList = props.get("simple_products_list"); -} -String productUrl = vars.get("request_protocol") + "://" + vars.get("host") + vars.get("base_path") + vars.get("simple_products_url_keys_" + vars.get("simple_products_counter"))+ vars.get("url_suffix"); -encodedUrl = Base64.encodeBase64(productUrl.getBytes()); -// Create product map -Map productMap = new HashMap(); -productMap.put("id", vars.get("simple_product_id")); -productMap.put("title", vars.get("simple_product_names_" + vars.get("simple_products_counter"))); -productMap.put("url_key", vars.get("simple_products_url_keys_" + vars.get("simple_products_counter"))); -productMap.put("uenc", new String(encodedUrl)); - -// Collect products map in products list -productList.add(productMap); - - - false - - - - - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^[a-z0-9-]+$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - 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 - false - - - - - false - configurable_products_url_keys - url_key\",\"value\":\"(.*?)\" - $1$ - - -1 - - - - false - configurable_product_ids - \"id\":(\d+), - $1$ - - -1 - - - - false - configurable_product_names - name\":\"(.*?)\" - $1$ - - -1 - - - - false - configurable_product_skus - sku\":\"(.*?)\" - $1$ - - -1 - - - - - - configurable_product_ids - configurable_product_id - true - - - - 1 - - 1 - configurable_products_counter - - false - - - - import java.util.ArrayList; -import java.util.HashMap; -import org.apache.commons.codec.binary.Base64; - -// 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"); -} - -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)); - -// Collect products map in products list -productList.add(productMap); - - - false - - - - - - - - - - - - ${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 - - - - - - - - - true - customer_listing - = - true - namespace - - - true - - = - true - search - - - true - customer_since[locale]=en_US&website_id=1 - = - true - filters[placeholder] - - - true - ${customers_page_size} - = - true - paging[pageSize] - - - true - 1 - = - true - paging[current] - - - true - entity_id - = - true - sorting[field] - - - true - asc - = - true - sorting[direction] - - - true - true - = - true - isAjax - - - - - - - - ${request_protocol} - - ${base_path}${admin_path}/mui/index/render/ - GET - true - false - true - false - false - - - - - - \"totalRecords\":0 - - Assertion.response_data - false - 20 - - - - false - customer_emails - \"email\":\"([^"]+) - $1$ - - -1 - - - - false - customer_ids - \"entity_id\":\"([^"]+) - $1$ - - -1 - - - - - customer_emails - customer_email - true - - - - 1 - - 1 - email_counter - - false - - - - import java.util.ArrayList; - -// If it is first iteration of cycle then recreate emailsList -if (1 == Integer.parseInt(vars.get("email_counter"))) { - emailsList = new ArrayList(); - props.put("customer_emails_list", emailsList); -} else { - emailsList = props.get("customer_emails_list"); -} -emailsList.add(vars.get("customer_email")); - - - 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"); -} -idsList.add(vars.get("customer_id")); - - - false - - - - - Boolean stopTestOnError (String error) { - log.error(error); - System.out.println(error); - SampleResult.setStopTest(true); - return false; -} - -if (props.get("simple_products_list") == null) { - return stopTestOnError("Cannot find simple products. Test stopped."); -} -if (props.get("configurable_products_list") == null) { - return stopTestOnError("Cannot find configurable products. Test stopped."); -} -if (props.get("customer_emails_list") == null) { - return stopTestOnError("Cannot find customer emails. Test stopped."); -} -if (props.get("category_url_keys_list") == null) { - return stopTestOnError("Cannot find category url keys. Test stopped."); -} -if (props.get("category_names_list") == null) { - return stopTestOnError("Cannot find category names. Test stopped."); -} -int orders = Integer.parseInt(vars.get("orders")); - - -if (orders > 0) { - int checkout_sum = Integer.parseInt(vars.get("guest_checkout_percent")) + Integer.parseInt(vars.get("customer_checkout_percent")); - checkout_sum = checkout_sum > 0 ? checkout_sum : 1; - int users = orders * (100 / checkout_sum); - props.put("users", users); -} else { - props.put("users", Integer.parseInt(vars.get("users"))); -} - - - - false - - - - "${cache_indicator}" == "1" || "${cache_indicator}" == "2" - false - - - - // Default to disable all cache types -vars.put("cache_types", "config,layout,block_html,collections,reflection,db_ddl,eav,config_integration,full_page,target_rule,translate,config_webservice,config_integration_api"); - -if ("${cache_indicator}" == "1") { - // Only disable Full Page Cache - vars.put("cache_types", "full_page"); -} - - - - false - - - - - - - true - ${admin_form_key} - = - true - form_key - - - true - types - = - true - massaction_prepare_key - - - true - ${cache_types} - = - true - types - - - - - - - - ${request_protocol} - - ${base_path}${admin_path}/admin/cache/massDisable - POST - true - false - true - false - true - false - - - - - - "${cache_indicator}" == "0" - false - - - - - - - false - ${admin_form_key} - = - true - form_key - true - - - - - - - - ${request_protocol} - - ${base_path}${admin_path}/admin/cache/ - GET - true - false - true - false - true - false - - - - - - TRANSLATE(?s).+?<span>Enabled</span> - CONFIG(?s).+?<span>Enabled</span> - LAYOUT_GENERAL_CACHE_TAG(?s).+?<span>Enabled</span> - BLOCK_HTML(?s).+?<span>Enabled</span> - COLLECTION_DATA(?s).+?<span>Enabled</span> - EAV(?s).+?<span>Enabled</span> - FPC(?s).+?<span>Enabled</span> - DB_DDL(?s).+?<span>Enabled</span> - INTEGRATION(?s).+?<span>Enabled</span> - INTEGRATION_API_CONFIG(?s).+?<span>Enabled</span> - WEBSERVICE(?s).+?<span>Enabled</span> - REFLECTION(?s).+?<span>Enabled</span> - TARGET_RULE(?s).+?<span>Enabled</span> - - Assertion.response_data - false - 2 - - - - - - "${cache_indicator}" == "1" - false - - - - - - - false - ${admin_form_key} - = - true - form_key - true - - - - - - - - ${request_protocol} - - ${base_path}${admin_path}/admin/cache/ - GET - true - false - true - false - true - false - - - - - - TRANSLATE(?s).+?<span>Enabled</span> - CONFIG(?s).+?<span>Enabled</span> - LAYOUT_GENERAL_CACHE_TAG(?s).+?<span>Enabled</span> - BLOCK_HTML(?s).+?<span>Enabled</span> - COLLECTION_DATA(?s).+?<span>Enabled</span> - EAV(?s).+?<span>Enabled</span> - FPC(?s).+?<span>Disabled</span> - DB_DDL(?s).+?<span>Enabled</span> - INTEGRATION(?s).+?<span>Enabled</span> - INTEGRATION_API_CONFIG(?s).+?<span>Enabled</span> - WEBSERVICE(?s).+?<span>Enabled</span> - REFLECTION(?s).+?<span>Enabled</span> - TARGET_RULE(?s).+?<span>Enabled</span - - Assertion.response_data - false - 2 - - - - - - "${cache_indicator}" == "2" - false - - - - - - - false - ${admin_form_key} - = - true - form_key - true - - - - - - - - ${request_protocol} - - ${base_path}${admin_path}/admin/cache/ - GET - true - false - true - false - true - false - - - - - - TRANSLATE(?s).+?<span>Disabled</span> - CONFIG(?s).+?<span>Disabled</span> - LAYOUT_GENERAL_CACHE_TAG(?s).+?<span>Disabled</span> - BLOCK_HTML(?s).+?<span>Disabled</span> - COLLECTION_DATA(?s).+?<span>Disabled</span> - EAV(?s).+?<span>Disabled</span> - FPC(?s).+?<span>Disabled</span> - DB_DDL(?s).+?<span>Disabled</span> - INTEGRATION(?s).+?<span>Disabled</span> - INTEGRATION_API_CONFIG(?s).+?<span>Disabled</span> - WEBSERVICE(?s).+?<span>Disabled</span> - REFLECTION(?s).+?<span>Disabled</span> - TARGET_RULE(?s).+?<span>Disabled</span - - Assertion.response_data - false - 2 - - - - - - - - - true - ["customer_form_login"] - = - true - blocks - - - true - ["default","customer_account_login"] - = - true - handles - - - true - {"route":"customer","controller":"account","action":"login","uri":"/customer/account/login/"} - = - true - originalRequest - - - true - true - = - true - ajax - - - true - true - = - true - isAjax - - - - - - - - ${request_protocol} - - ${base_path}page_cache/block/render/ - GET - true - false - true - false - false - - - - - - "customer_form_login" - Registered Customers - form_key - - Assertion.response_data - false - 2 - - - - false - form_key - <input name=\\"form_key\\" type=\\"hidden\\" value=\\"([^'"]+)\\" \\/> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - form_key - - - - - - - - false - 1 - = - true - product - - - false - - = - true - related_product - - - false - 1 - = - true - qty - - - false - ${form_key} - = - true - form_key - - - - - - - - ${request_protocol} - - ${base_path}checkout/cart/add - POST - true - false - true - false - false - - - - - - - continue - - false - ${loops} - - ${__javaScript(Math.round(props.get("users")*${view_catalog_percent}/100>>0))} - ${ramp_period} - 1437409133000 - 1437409133000 - false - - - - - - Passing arguments between threads - -import java.util.Random; -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom}); -} -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("simple_products_list").size()); -simpleList = props.get("simple_products_list").get(number1); -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")); - -number = random.nextInt(props.get("category_url_keys_list").size()); -vars.put("category_url_key", props.get("category_url_keys_list").get(number)); -vars.put("category_name", props.get("category_names_list").get(number)); -vars.put("testLabel", "CatProdBrows"); - - - true - - - - - - - - - - - - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${simple_product_1_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${simple_product_1_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - product_id - .//input[@type="hidden" and @name="product"]/@value - false - true - false - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - product_id - - - - - - - - - - - - ${request_protocol} - - ${base_path}review/product/listAjax/id/${product_id}/ - GET - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${simple_product_2_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${simple_product_2_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - product_id - .//input[@type="hidden" and @name="product"]/@value - false - true - false - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - product_id - - - - - - - - - - - - ${request_protocol} - - ${base_path}review/product/listAjax/id/${product_id}/ - GET - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${configurable_product_1_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${configurable_product_1_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - - - continue - - false - ${loops} - - ${__javaScript(Math.round(props.get("users")*${view_product_add_to_cart_percent}/100>>0))} - ${ramp_period} - 1437411475000 - 1437411475000 - false - - - - - - Passing arguments between threads - -import java.util.Random; -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom}); -} -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")); -vars.put("simple_product_1_uenc", simpleList.get("uenc")); - -number1 = random.nextInt(props.get("simple_products_list").size()); -simpleList = props.get("simple_products_list").get(number1); -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")); -vars.put("simple_product_2_uenc", simpleList.get("uenc")); - -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_attribute_id", configurableList.get("attribute_id")); -vars.put("configurable_option_id", configurableList.get("attribute_option_id")); -vars.put("configurable_product_1_uenc", simpleList.get("uenc")); - -number = random.nextInt(props.get("category_url_keys_list").size()); -vars.put("category_url_key", props.get("category_url_keys_list").get(number)); -vars.put("category_name", props.get("category_names_list").get(number)); -vars.put("testLabel", "BrowsAddToCart"); -vars.put("loadType", "Guest"); - - - true - - - - - - - - - - - - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ["customer_form_login"] - = - true - blocks - - - true - ["default","customer_account_login"] - = - true - handles - - - true - {"route":"customer","controller":"account","action":"login","uri":"/customer/account/login/"} - = - true - originalRequest - - - true - true - = - true - ajax - - - true - true - = - true - isAjax - - - - - - - - ${request_protocol} - - ${base_path}page_cache/block/render/ - GET - true - false - true - false - false - - - - - - "customer_form_login" - Registered Customers - form_key - - Assertion.response_data - false - 2 - - - - false - form_key - <input name=\\"form_key\\" type=\\"hidden\\" value=\\"([^'"]+)\\" \\/> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - form_key - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${simple_product_1_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${simple_product_1_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - product_id - .//input[@type="hidden" and @name="product"]/@value - false - true - false - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - product_id - - - - - - - - - - - - ${request_protocol} - - ${base_path}review/product/listAjax/id/${product_id}/ - GET - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - false - ${simple_product_1_id} - = - true - product - - - false - - = - true - related_product - - - false - 1 - = - true - qty - - - false - ${form_key} - = - true - form_key - - - - - - - - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - false - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - _ - - - - - - - - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - You added ${simple_product_1_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":1 - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${simple_product_2_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${simple_product_2_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - product_id - .//input[@type="hidden" and @name="product"]/@value - false - true - false - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - product_id - - - - - - - - - - - - ${request_protocol} - - ${base_path}review/product/listAjax/id/${product_id}/ - GET - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - false - ${simple_product_2_id} - = - true - product - - - false - - = - true - related_product - - - false - 1 - = - true - qty - - - false - ${form_key} - = - true - form_key - - - - - - - - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - - - - true - cart,messages - = - true - sections - true - - - true - true - = - true - force_new_section_timestamp - true - - - false - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - _ - true - - - - - - - - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - You added ${simple_product_2_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":2 - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${configurable_product_1_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${configurable_product_1_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - false - configurable_product_sku - itemprop="sku">([^<]*)<\/ - $1$ - NOT_FOUND - 1 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - true - 1 - - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^[a-z0-9-]+$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${configurable_product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - false - ${configurable_product_1_id} - = - true - product - - - false - - = - true - related_product - - - false - 1 - = - true - qty - - - false - ${configurable_option_id} - = - true - super_attribute[${configurable_attribute_id}] - - - false - ${form_key} - = - true - form_key - - - - - - - - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - - - - - - - - - true - cart,messages - = - true - sections - true - - - true - true - = - true - force_new_section_timestamp - true - - - false - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - _ - true - - - - - - - - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - You added ${configurable_product_1_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - We don't have as many &quot;${configurable_product_1_name}&quot; as you requested. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":3 - - Assertion.response_data - false - 2 - - - - - - - continue - - false - ${loops} - - ${__javaScript(Math.round(props.get("users")*${guest_checkout_percent}/100>>0))} - ${ramp_period} - 1437409133000 - 1437409133000 - false - - - - - - Passing arguments between threads - -import java.util.Random; -Random random = new Random(); -if (${seedForRandom} > 0) { - random.setSeed(${seedForRandom}); -} -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")); -vars.put("simple_product_1_uenc", simpleList.get("uenc")); - -number1 = random.nextInt(props.get("simple_products_list").size()); -simpleList = props.get("simple_products_list").get(number1); -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")); -vars.put("simple_product_2_uenc", simpleList.get("uenc")); - -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_attribute_id", configurableList.get("attribute_id")); -vars.put("configurable_option_id", configurableList.get("attribute_option_id")); -vars.put("configurable_product_1_uenc", simpleList.get("uenc")); - -number = random.nextInt(props.get("category_url_keys_list").size()); -vars.put("category_url_key", props.get("category_url_keys_list").get(number)); -vars.put("category_name", props.get("category_names_list").get(number)); -vars.put("testLabel", "GuestChkt"); -vars.put("loadType", "Guest"); - - - true - - - - - - - - - - - - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ["customer_form_login"] - = - true - blocks - - - true - ["default","customer_account_login"] - = - true - handles - - - true - {"route":"customer","controller":"account","action":"login","uri":"/customer/account/login/"} - = - true - originalRequest - - - true - true - = - true - ajax - - - true - true - = - true - isAjax - - - - - - - - ${request_protocol} - - ${base_path}page_cache/block/render/ - GET - true - false - true - false - false - - - - - - "customer_form_login" - Registered Customers - form_key - - Assertion.response_data - false - 2 - - - - false - form_key - <input name=\\"form_key\\" type=\\"hidden\\" value=\\"([^'"]+)\\" \\/> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - form_key - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${simple_product_1_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${simple_product_1_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - product_id - .//input[@type="hidden" and @name="product"]/@value - false - true - false - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - product_id - - - - - - - - - - - - ${request_protocol} - - ${base_path}review/product/listAjax/id/${product_id}/ - GET - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - false - ${simple_product_1_id} - = - true - product - - - false - - = - true - related_product - - - false - 1 - = - true - qty - - - false - ${form_key} - = - true - form_key - - - - - - - - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - false - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - _ - - - - - - - - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - You added ${simple_product_1_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":1 - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${simple_product_2_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${simple_product_2_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - product_id - .//input[@type="hidden" and @name="product"]/@value - false - true - false - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - product_id - - - - - - - - - - - - ${request_protocol} - - ${base_path}review/product/listAjax/id/${product_id}/ - GET - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - false - ${simple_product_2_id} - = - true - product - - - false - - = - true - related_product - - - false - 1 - = - true - qty - - - false - ${form_key} - = - true - form_key - - - - - - - - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - - - - true - cart,messages - = - true - sections - true - - - true - true - = - true - force_new_section_timestamp - true - - - false - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - _ - true - - - - - - - - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - You added ${simple_product_2_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":2 - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${configurable_product_1_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${configurable_product_1_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - false - configurable_product_sku - itemprop="sku">([^<]*)<\/ - $1$ - NOT_FOUND - 1 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - true - 1 - - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^[a-z0-9-]+$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${configurable_product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - false - ${configurable_product_1_id} - = - true - product - - - false - - = - true - related_product - - - false - 1 - = - true - qty - - - false - ${configurable_option_id} - = - true - super_attribute[${configurable_attribute_id}] - - - false - ${form_key} - = - true - form_key - - - - - - - - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - - - - - - - - - true - cart,messages - = - true - sections - true - - - true - true - = - true - force_new_section_timestamp - true - - - false - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - _ - true - - - - - - - - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - You added ${configurable_product_1_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - We don't have as many &quot;${configurable_product_1_name}&quot; as you requested. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":3 - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}checkout/ - GET - true - false - true - false - false - - - - - - <title>Checkout</title> - - Assertion.response_data - false - 2 - - - - - <title>Shopping Cart</title> - - Assertion.response_data - false - 6 - - - - false - cart_id - "quoteData":{"entity_id":"([^'"]+)", - $1$ - - 1 - - - - false - form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - form_key - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - true - - - - false - {"customerEmail":"test@example.com"} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/customers/isEmailAvailable - POST - true - false - true - false - false - - - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - true - - Assertion.response_data - false - 8 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - true - - - - false - {"address":{"country_id":"US","postcode":"95630"}} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/estimate-shipping-methods - POST - true - false - true - false - false - - - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "available":true - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - true - - - - false - {"addressInformation":{"shipping_address":{"countryId":"US","regionId":"12","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"},"shipping_method_code":"flatrate","shipping_carrier_code":"flatrate"}} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/shipping-information - POST - true - false - true - false - false - - - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - {"payment_methods": - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - true - - - - false - {"cartId":"${cart_id}","email":"test@example.com","paymentMethod":{"method":"checkmo","po_number":null,"additional_data":null},"billingAddress":{"countryId":"US","regionId":"12","regionCode":"CA","region":"California","street":["10441 Jefferson Blvd ste 200"],"company":"","telephone":"3109450345","fax":"","postcode":"90232","city":"Culver City","firstname":"Name","lastname":"Lastname"}} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/guest-carts/${cart_id}/payment-information - POST - true - false - true - false - false - - - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "[0-9]+" - - Assertion.response_data - false - 2 - - - - order_id - $ - - - BODY - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - order_id - - - - - - - - - - - - - ${request_protocol} - - ${base_path}checkout/onepage/success/ - GET - true - false - true - false - false - - - - - - Thank you for your purchase! - Your order # is - - Assertion.response_data - false - 2 - - - - - - - continue - - false - ${loops} - - ${__javaScript(Math.round(props.get("users")*${customer_checkout_percent}/100>>0))} - ${ramp_period} - 1437177203000 - 1437177203000 - false - - - - - - Passing arguments between threads - 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").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")); -vars.put("simple_product_1_uenc", simpleList.get("uenc")); - -number1 = random.nextInt(props.get("simple_products_list").size()); -simpleList = props.get("simple_products_list").get(number1); -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")); -vars.put("simple_product_2_uenc", simpleList.get("uenc")); - -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_attribute_id", configurableList.get("attribute_id")); -vars.put("configurable_option_id", configurableList.get("attribute_option_id")); -vars.put("configurable_product_1_uenc", simpleList.get("uenc")); - -number = random.nextInt(props.get("category_url_keys_list").size()); -vars.put("category_url_key", props.get("category_url_keys_list").get(number)); -vars.put("category_name", props.get("category_names_list").get(number)); - -emails_index = 0; -if (!props.containsKey("customer_emails_index")) { - props.put("customer_emails_index", emails_index); -} - -try { - emails_index = props.get("customer_emails_index"); - emails_list = props.get("customer_emails_list"); - if (emails_index == emails_list.size()) { - emails_index=0; - } - vars.put("customer_email", emails_list.get(emails_index)); - props.put("customer_emails_index", ++emails_index); -} -catch (java.lang.Exception e) { - log.error("Caught Exception in 'Customer Checkout' thread."); - log.info("Using default email address - user_1@example.com"); - vars.put("customer_email", "user_1@example.com"); -} -vars.put("testLabel", "CustomerChkt"); -vars.put("loadType", "Customer"); - - - true - - - - - - - - - - - - ${request_protocol} - - ${base_path} - GET - true - false - true - false - false - - - - - - <title>Home page</title> - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}customer/account/login/ - GET - true - false - true - false - false - - - - - - <title>Customer Login</title> - - Assertion.response_data - false - 2 - - - - - - - - - true - ["customer_form_login"] - = - true - blocks - - - true - ["default","customer_account_login"] - = - true - handles - - - true - {"route":"customer","controller":"account","action":"login","uri":"/customer/account/login/"} - = - true - originalRequest - - - true - true - = - true - ajax - - - true - true - = - true - isAjax - - - - - - - - ${request_protocol} - - ${base_path}page_cache/block/render/ - GET - true - false - true - false - false - - - - - - "customer_form_login" - Registered Customers - form_key - - Assertion.response_data - false - 2 - - - - false - form_key - <input name=\\"form_key\\" type=\\"hidden\\" value=\\"([^'"]+)\\" \\/> - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - form_key - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - true - ${form_key} - = - true - form_key - - - true - ${customer_email} - = - true - login[username] - - - true - ${customer_password} - = - true - login[password] - - - true - - = - true - send - - - - - - - - ${request_protocol} - - ${base_path}customer/account/loginPost/ - POST - true - false - true - false - false - - - - - - <title>My Account</title> - - Assertion.response_data - false - 2 - - - - false - addressId - customer/address/edit/id/([^'"]+)/ - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - addressId - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${category_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <span class="base" data-ui-id="page-title">${category_name}</span> - - Assertion.response_data - false - 6 - - - - false - category_id - <li class="item category([^'"]+)">\s*<strong>${category_name}</strong>\s*</li> - $1$ - - 1 - simple_product_1_url_key - - - - - ^[0-9]+$ - - Assertion.response_data - false - 1 - variable - category_id - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${simple_product_1_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${simple_product_1_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - product_id - .//input[@type="hidden" and @name="product"]/@value - false - true - false - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - product_id - - - - - - - - - - - - ${request_protocol} - - ${base_path}review/product/listAjax/id/${product_id}/ - GET - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - false - ${simple_product_1_id} - = - true - product - - - false - - = - true - related_product - - - false - 1 - = - true - qty - - - false - ${form_key} - = - true - form_key - - - - - - - - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - - - - true - cart,messages - = - true - sections - - - true - true - = - true - force_new_section_timestamp - - - false - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - _ - - - - - - - - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - You added ${simple_product_1_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":1 - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${simple_product_2_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${simple_product_2_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - product_id - .//input[@type="hidden" and @name="product"]/@value - false - true - false - - - - - ^\d+$ - - Assertion.response_data - false - 1 - variable - product_id - - - - - - - - - - - - ${request_protocol} - - ${base_path}review/product/listAjax/id/${product_id}/ - GET - true - false - true - false - false - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - false - ${simple_product_2_id} - = - true - product - - - false - - = - true - related_product - - - false - 1 - = - true - qty - - - false - ${form_key} - = - true - form_key - - - - - - - - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - - - - true - cart,messages - = - true - sections - true - - - true - true - = - true - force_new_section_timestamp - true - - - false - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - _ - true - - - - - - - - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - You added ${simple_product_2_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - This product is out of stock. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":2 - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}${configurable_product_1_url_key}${url_suffix} - GET - true - false - true - false - false - - - - - - <title>${configurable_product_1_name} - <span>In stock</span> - - Assertion.response_data - false - 2 - - - - - false - configurable_product_sku - itemprop="sku">([^<]*)<\/ - $1$ - NOT_FOUND - 1 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - true - 1 - - - - - - Content-Type - application/json - - - Accept - */* - - - - - - true - - - - false - {"username":"${admin_user}","password":"${admin_password}"} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/integration/admin/token - POST - true - false - true - false - false - - - - - admin_token - $ - - - BODY - - - - - ^[a-z0-9-]+$ - - Assertion.response_data - false - 1 - variable - admin_token - - - - - - - Authorization - Bearer ${admin_token} - - - - - - - - - - - - - ${request_protocol} - - ${base_path}rest/V1/configurable-products/${configurable_product_sku}/options/all - GET - true - false - true - false - false - - - - - attribute_ids - $.[*].attribute_id - NO_VALUE - - BODY - - - - option_values - $.[*].values[0].value_index - NO_VALUE - - BODY - - - - - - - - - - false - ${configurable_product_1_id} - = - true - product - - - false - - = - true - related_product - - - false - 1 - = - true - qty - - - false - ${configurable_option_id} - = - true - super_attribute[${configurable_attribute_id}] - - - false - ${form_key} - = - true - form_key - - - - - - - - ${request_protocol} - - ${base_path}checkout/cart/add/ - POST - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - false - - - - try { - attribute_ids = vars.get("attribute_ids"); - option_values = vars.get("option_values"); - attribute_ids = attribute_ids.replace("[","").replace("]","").replace("\"", ""); - option_values = option_values.replace("[","").replace("]","").replace("\"", ""); - attribute_ids_array = attribute_ids.split(","); - option_values_array = option_values.split(","); - args = ctx.getCurrentSampler().getArguments(); - it = args.iterator(); - while (it.hasNext()) { - argument = it.next(); - if (argument.getStringValue().contains("${")) { - args.removeArgument(argument.getName()); - } - } - for (int i = 0; i < attribute_ids_array.length; i++) { - ctx.getCurrentSampler().addArgument("super_attribute[" + attribute_ids_array[i] + "]", option_values_array[i]); - } - } catch (Exception e) { - log.error("eror…", e); - } - - - - - - - - - - true - cart,messages - = - true - sections - true - - - true - true - = - true - force_new_section_timestamp - true - - - false - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - _ - true - - - - - - - - ${request_protocol} - - ${base_path}customer/section/load/ - GET - true - false - true - false - false - - - - - - - X-Requested-With - XMLHttpRequest - - - - - - - - You added ${configurable_product_1_name} to your shopping cart. - - Assertion.response_data - false - 2 - - - - - We don't have as many &quot;${configurable_product_1_name}&quot; as you requested. - - Assertion.response_data - false - 6 - - - - - \"summary_count\":3 - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}checkout/ - GET - true - false - true - false - false - - - - - - <title>Checkout</title> - - Assertion.response_data - false - 2 - - - - - <title>Shopping Cart</title> - - Assertion.response_data - false - 6 - - - - false - cart_id - "quoteData":{"entity_id":"([^'"]+)", - $1$ - - 1 - - - - false - form_key - <input name="form_key" type="hidden" value="([^'"]+)" /> - $1$ - - 1 - - - - false - address_id - "default_billing":"([^'"]+)", - $1$ - - 1 - - - - false - customer_id - "customer_id":([^'",]+), - $1$ - - 1 - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - cart_id - - - - - ^.+$ - - Assertion.response_data - false - 1 - variable - form_key - - - - - [0-9]+$ - - Assertion.response_data - false - 1 - variable - address_id - - - - - [0-9]+$ - - Assertion.response_data - false - 1 - variable - customer_id - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - true - - - - false - {"addressId":"${addressId}"} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id - POST - true - false - true - false - false - - - - - - - Referer - ${base_path}checkout/onepage/ - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - "available":true - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - true - - - - false - {"addressInformation":{"shipping_address":{"customerAddressId":"${address_id}","countryId":"US","regionId":5,"regionCode":"AR","region":"Arkansas","customerId":"${customer_id}","street":["123 Freedom Blvd. #123"],"telephone":"022-333-4455","postcode":"123123","city":"Fayetteville","firstname":"Anthony","lastname":"Nealy"},"shipping_method_code":"flatrate","shipping_carrier_code":"flatrate"}} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/shipping-information - POST - true - false - true - false - false - - - - - - - Referer - ${host}${base_path}checkout/onepage - - - Content-Type - application/json; charset=UTF-8 - - - X-Requested-With - XMLHttpRequest - - - Accept - application/json - - - - - - - {"payment_methods" - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - true - - - - false - {"cartId":"${cart_id}","paymentMethod":{"method":"checkmo","po_number":null,"additional_data":null},"billingAddress":{"customerAddressId":"${address_id}","countryId":"US","regionId":5,"regionCode":"AR","region":"Arkansas","customerId":"${customer_id}","street":["123 Freedom Blvd. #123"],"telephone":"022-333-4455","postcode":"123123","city":"Fayetteville","firstname":"Anthony","lastname":"Nealy"}} - = - - - - - - - - ${request_protocol} - - ${base_path}rest/default/V1/carts/mine/payment-information - POST - true - false - true - false - false - - - - - - - Referer - ${host}${base_path}checkout/onepage - - - Content-Type - application/json; charset=UTF-8 - - - Accept - application/json - - - X-Requested-With - XMLHttpRequest - - - - - - - "[0-9]+" - - Assertion.response_data - false - 2 - - - - - - ${think_time_delay_offset} - ${think_time_deviation} - - - - - - - - - - - - ${request_protocol} - - ${base_path}checkout/onepage/success/ - GET - true - false - true - false - false - - - - - - Thank you for your purchase! - Your order number is - - Assertion.response_data - false - 2 - - - - - - - stoptest - - false - 1 - - 1 - 1 - 1395324075000 - 1395324075000 - false - - - - - - "${dashboard_enabled}" == "1" - false - - - - - - - false - ${__property(environment)} - = - true - environment - - - false - ${start_time} - = - true - startTime - - - false - ${__time(yyyy-MM-dd'T'HH:mm:ss.SSSZ)} - = - true - endTime - - - false - ${redis_host} - = - true - stats_server - - - - - - - - ${request_protocol} - - ${base_path}DeploymentEvent.php - POST - true - false - true - false - false - - - - - - Errors: - - Assertion.response_data - false - 6 - - - - - - - 30 - ${host} - / - false - 0 - true - true - - - true - - - - props.remove("category_url_key"); -props.remove("category_name"); -props.remove("simple_products_list"); -props.remove("configurable_products_list"); -props.remove("users"); -props.remove("customer_emails_list"); - - - false - - - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - false - false - false - false - false - 0 - true - true - - - - - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - true - false - false - 0 - true - true - true - true - - - - - - - - false - - saveConfig - - - false - false - false - - false - false - false - false - false - false - false - false - false - false - true - false - false - false - false - 0 - true - true - true - true - - - ${report_save_path}/detailed-urls-report.log - - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - false - false - false - false - false - 0 - true - true - true - true - - - ${report_save_path}/summary-report.log - - - - - true - - - From 8b174750163f2381e0b7476f1512e154ef0cde57 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Mon, 1 Aug 2022 13:18:45 -0500 Subject: [PATCH 56/57] ACPT-6: Update Readme.md for ImportCsvApi --- app/code/Magento/ImportCsvApi/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/ImportCsvApi/README.md b/app/code/Magento/ImportCsvApi/README.md index ceb3de3ea3279..8f2b05b3ab2d8 100644 --- a/app/code/Magento/ImportCsvApi/README.md +++ b/app/code/Magento/ImportCsvApi/README.md @@ -1,3 +1,5 @@ # ImportCsvApi module -The `ImportCsvApi` module provides service contracts interfaces for upload CSV sources +The `ImportCsvApi` module provides service contracts interfaces for uploading CSV sources + +**API Endpoint**: {domain}/rest/default/V1/import/csv From a228534d7f0896d54f2d2e45921b3b17aef557e6 Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 2 Aug 2022 21:03:53 -0500 Subject: [PATCH 57/57] ACPT-678: Migrate API from CE to EE --- .../Magento/ImportCsv/Model/SourceData.php | 120 ------------- .../Magento/ImportCsv/Model/StartImport.php | 164 ------------------ app/code/Magento/ImportCsv/README.md | 3 - app/code/Magento/ImportCsv/composer.json | 23 --- app/code/Magento/ImportCsv/etc/di.xml | 16 -- app/code/Magento/ImportCsv/etc/module.xml | 11 -- app/code/Magento/ImportCsv/registration.php | 10 -- .../Api/Data/SourceDataInterface.php | 98 ----------- .../ImportCsvApi/Api/StartImportInterface.php | 29 ---- app/code/Magento/ImportCsvApi/README.md | 5 - app/code/Magento/ImportCsvApi/composer.json | 21 --- app/code/Magento/ImportCsvApi/etc/acl.xml | 20 --- app/code/Magento/ImportCsvApi/etc/module.xml | 11 -- app/code/Magento/ImportCsvApi/etc/webapi.xml | 16 -- .../Magento/ImportCsvApi/registration.php | 10 -- composer.json | 2 - .../ImportCsv/Api/ImportCsvApiTest.php | 76 -------- .../ImportCsv/Api/_files/advanced_pricing.csv | 2 - .../Magento/ImportCsv/Api/_files/products.csv | 4 - 19 files changed, 641 deletions(-) delete mode 100644 app/code/Magento/ImportCsv/Model/SourceData.php delete mode 100644 app/code/Magento/ImportCsv/Model/StartImport.php delete mode 100644 app/code/Magento/ImportCsv/README.md delete mode 100644 app/code/Magento/ImportCsv/composer.json delete mode 100644 app/code/Magento/ImportCsv/etc/di.xml delete mode 100644 app/code/Magento/ImportCsv/etc/module.xml delete mode 100644 app/code/Magento/ImportCsv/registration.php delete mode 100644 app/code/Magento/ImportCsvApi/Api/Data/SourceDataInterface.php delete mode 100644 app/code/Magento/ImportCsvApi/Api/StartImportInterface.php delete mode 100644 app/code/Magento/ImportCsvApi/README.md delete mode 100644 app/code/Magento/ImportCsvApi/composer.json delete mode 100644 app/code/Magento/ImportCsvApi/etc/acl.xml delete mode 100644 app/code/Magento/ImportCsvApi/etc/module.xml delete mode 100644 app/code/Magento/ImportCsvApi/etc/webapi.xml delete mode 100644 app/code/Magento/ImportCsvApi/registration.php delete mode 100644 dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/ImportCsvApiTest.php delete mode 100644 dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/advanced_pricing.csv delete mode 100755 dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/products.csv diff --git a/app/code/Magento/ImportCsv/Model/SourceData.php b/app/code/Magento/ImportCsv/Model/SourceData.php deleted file mode 100644 index c1f1b95559908..0000000000000 --- a/app/code/Magento/ImportCsv/Model/SourceData.php +++ /dev/null @@ -1,120 +0,0 @@ -entity; - } - - /** - * @inheritdoc - */ - public function getBehavior(): string - { - return $this->behavior; - } - - /** - * @inheritdoc - */ - public function getValidationStrategy(): string - { - return $this->validationStrategy; - } - - /** - * @inheritdoc - */ - public function getAllowedErrorCount(): string - { - return $this->allowedErrorCount; - } - - /** - * @inheritDoc - */ - public function getCsvData() - { - return $this->csvData; - } - - /** - * @inheritDoc - */ - public function setEntity($entity) - { - return $this->setData(self::ENTITY, $entity); - } - - /** - * @inheritDoc - */ - public function setBehavior($behavior) - { - return $this->setData(self::BEHAVIOR, $behavior); - } - - /** - * @inheritDoc - */ - public function setValidationStrategy($validationStrategy) - { - return $this->setData(self::VALIDATION_STRATEGY, $validationStrategy); - } - - /** - * @inheritDoc - */ - public function setAllowedErrorCount($allowedErrorCount) - { - return $this->setData(self::ALLOWED_ERROR_COUNT, $allowedErrorCount); - } - - /** - * @inheritDoc - */ - public function setCsvData($csvData) - { - return $this->setData(self::PAYLOAD, $csvData); - } -} diff --git a/app/code/Magento/ImportCsv/Model/StartImport.php b/app/code/Magento/ImportCsv/Model/StartImport.php deleted file mode 100644 index 8072d9cb35602..0000000000000 --- a/app/code/Magento/ImportCsv/Model/StartImport.php +++ /dev/null @@ -1,164 +0,0 @@ -import = $import; - $this->sourceFactory = $sourceFactory; - } - - /** - * @inheritdoc - */ - public function execute( - SourceDataInterface $source - ): array { - $source = $source->__toArray(); - $import = $this->import->setData($source); - $errors = []; - try { - $source = $this->sourceFactory->create($import->getData('csvData')); - $this->processValidationResult($import->validateSource($source), $errors); - } catch (\Magento\Framework\Exception\LocalizedException $e) { - $errors[] = $e->getMessage(); - } catch (\Exception $e) { - $errors[] ='Sorry, but the data is invalid or the file is not uploaded.'; - } - if ($errors) { - return $errors; - } - $processedEntities = $this->import->getProcessedEntitiesCount(); - $errorAggregator = $this->import->getErrorAggregator(); - $errorAggregator->initValidationStrategy( - $this->import->getData(Import::FIELD_NAME_VALIDATION_STRATEGY), - $this->import->getData(Import::FIELD_NAME_ALLOWED_ERROR_COUNT) - ); - try { - $this->import->importSource(); - } catch (\Exception $e) { - $errors[] = $e->getMessage(); - } - if ($this->import->getErrorAggregator()->hasToBeTerminated()) { - $errors[] ='Maximum error count has been reached or system error is occurred!'; - } else { - $this->import->invalidateIndex(); - } - if (!$errors) { - return ["Entities Processed: " . $processedEntities]; - } - return $errors; - } - - /** - * Process validation result and add required error or success messages to Result block - * - * @param bool $validationResult - * @param array $errors - * @return void - * @throws \Magento\Framework\Exception\LocalizedException - */ - private function processValidationResult($validationResult, $errors) - { - $import = $this->import; - $errorAggregator = $import->getErrorAggregator(); - - if ($import->getProcessedRowsCount()) { - if ($validationResult) { - $this->addMessageForValidResult($errors); - } else { - $errors[] = 'Data validation failed. Please fix the following errors and upload the file again.'; - if ($errorAggregator->getErrorsCount()) { - $this->addMessageToSkipErrors($errors); - } - } - } else { - if ($errorAggregator->getErrorsCount()) { - $this->collectErrors($errors); - } else { - $errors[] = (__('This file is empty. Please try another one.')); - } - } - } - - /** - * Add Message for Valid Result - * - * @param array $errors - * @return void - * @throws \Magento\Framework\Exception\LocalizedException - */ - private function addMessageForValidResult($errors) - { - if (!$this->import->isImportAllowed()) { - $errors[] =__('The file is valid, but we can\'t import it for some reason.'); - } - } - - /** - * Collect errors and add error messages - * - * Get all errors from Error Aggregator and add appropriated error messages - * - * @param array $errors - * @return void - * @throws \Magento\Framework\Exception\LocalizedException - */ - private function collectErrors($errors) - { - $errors = $this->import->getErrorAggregator()->getAllErrors(); - foreach ($errors as $error) { - $errors[] = $error->getErrorMessage(); - } - } - - /** - * Add error message to Result block and allow 'Import' button - * - * If validation strategy is equal to 'validation-skip-errors' and validation error limit is not exceeded, - * then add error message and allow 'Import' button. - * - * @param array $errors - * @return void - * @throws \Magento\Framework\Exception\LocalizedException - */ - private function addMessageToSkipErrors($errors) - { - $import = $this->import; - if ($import->getErrorAggregator()->hasFatalExceptions()) { - $errors[] =__('Please fix errors and re-upload file'); - } - } -} diff --git a/app/code/Magento/ImportCsv/README.md b/app/code/Magento/ImportCsv/README.md deleted file mode 100644 index 433b5d91df345..0000000000000 --- a/app/code/Magento/ImportCsv/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# ImportCsv module - -The `ImportCsv` module provides possibility to upload CSV files as source type diff --git a/app/code/Magento/ImportCsv/composer.json b/app/code/Magento/ImportCsv/composer.json deleted file mode 100644 index 6d32d55f78132..0000000000000 --- a/app/code/Magento/ImportCsv/composer.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "magento/module-import-csv", - "description": "N/A", - "require": { - "php": "~7.4.0||~8.1.0", - "magento/framework": "*", - "magento/module-import-csv-api": "*", - "magento/module-import-export": "*" - }, - "type": "magento2-module", - "license": [ - "OSL-3.0", - "AFL-3.0" - ], - "autoload": { - "files": [ - "registration.php" - ], - "psr-4": { - "Magento\\ImportCsv\\": "" - } - } -} diff --git a/app/code/Magento/ImportCsv/etc/di.xml b/app/code/Magento/ImportCsv/etc/di.xml deleted file mode 100644 index c71f0dd08102a..0000000000000 --- a/app/code/Magento/ImportCsv/etc/di.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - diff --git a/app/code/Magento/ImportCsv/etc/module.xml b/app/code/Magento/ImportCsv/etc/module.xml deleted file mode 100644 index ba8963a0f4a34..0000000000000 --- a/app/code/Magento/ImportCsv/etc/module.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - diff --git a/app/code/Magento/ImportCsv/registration.php b/app/code/Magento/ImportCsv/registration.php deleted file mode 100644 index b39c3ff6ebea0..0000000000000 --- a/app/code/Magento/ImportCsv/registration.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/code/Magento/ImportCsvApi/etc/module.xml b/app/code/Magento/ImportCsvApi/etc/module.xml deleted file mode 100644 index 80ba5655dc53c..0000000000000 --- a/app/code/Magento/ImportCsvApi/etc/module.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - diff --git a/app/code/Magento/ImportCsvApi/etc/webapi.xml b/app/code/Magento/ImportCsvApi/etc/webapi.xml deleted file mode 100644 index 62225e30e1a43..0000000000000 --- a/app/code/Magento/ImportCsvApi/etc/webapi.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/ImportCsvApi/registration.php b/app/code/Magento/ImportCsvApi/registration.php deleted file mode 100644 index 3585d18df4406..0000000000000 --- a/app/code/Magento/ImportCsvApi/registration.php +++ /dev/null @@ -1,10 +0,0 @@ - [ - 'resourcePath' => self::RESOURCE_PATH, - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST, - ], - 'soap' => [ - 'service' => self::SERVICE_NAME, - 'serviceVersion' => self::SERVICE_VERSION, - 'operation' => self::SERVICE_NAME . 'Execute' - ] - ]; - $requestData['source']['csvData'] = base64_encode(file_get_contents($requestData['source']['csvData'])); - $response = $this->_webApiCall($serviceInfo, $requestData); - $this->assertEquals($expectedResponse, array_values($response)); - } - - /** - * @return array - */ - public function getRequestData(): array - { - return [ - ['requestData' => [ - 'source' => [ - 'entity' => 'catalog_product', - 'behavior' => 'append', - 'validationStrategy' => 'validation-stop-on-errors', - 'allowedErrorCount' => '10', - 'csvData' => __DIR__ . '/_files/products.csv' - ] - ], - 'expectedResponse' => [ - 0 => 'Entities Processed: 3' - ]], - ['requestData' => [ - 'source' => [ - 'entity' => 'advanced_pricing', - 'behavior' => 'append', - 'validationStrategy' => 'validation-stop-on-errors', - 'allowedErrorCount' => '10', - 'csvData' => __DIR__ . '/_files/advanced_pricing.csv' - ] - ], - 'expectedResponse' => [ - 0 => 'Entities Processed: 1' - ]] - ]; - } -} diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/advanced_pricing.csv b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/advanced_pricing.csv deleted file mode 100644 index 70b101c44bab7..0000000000000 --- a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/advanced_pricing.csv +++ /dev/null @@ -1,2 +0,0 @@ -sku,tier_price_website,tier_price_customer_group,tier_price_qty,tier_price,tier_price_value_type -Simple1,"All Websites [USD]","NOT LOGGED IN",1.0000,250.000000,Fixed diff --git a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/products.csv b/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/products.csv deleted file mode 100755 index 6bc62e52c3fa9..0000000000000 --- a/dev/tests/api-functional/testsuite/Magento/ImportCsv/Api/_files/products.csv +++ /dev/null @@ -1,4 +0,0 @@ -sku,store_view_code,attribute_set_code,product_type,categories,product_websites,name,description,short_description,weight,product_online,tax_class_name,visibility,price,special_price,special_price_from_date,special_price_to_date,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,swatch_image,swatch_image_label,created_at,updated_at,new_from_date,new_to_date,display_product_options_in,map_price,msrp_price,map_enabled,gift_message_available,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_display_actual_price_type,country_of_manufacture,additional_attributes,qty,out_of_stock_qty,use_config_min_qty,is_qty_decimal,allow_backorders,use_config_backorders,min_cart_qty,use_config_min_sale_qty,max_cart_qty,use_config_max_sale_qty,is_in_stock,notify_on_stock_below,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,website_id,related_skus,related_position,crosssell_skus,crosssell_position,upsell_skus,upsell_position,additional_images,additional_image_labels,hide_from_product_page,custom_options,bundle_price_type,bundle_sku_type,bundle_price_view,bundle_weight_type,bundle_values,bundle_shipment_type,associated_skus,downloadable_links,downloadable_samples,configurable_variations,configurable_variation_labels -Simple1,,Default,simple,"Default Category",base,Simple1,,,1.000000,1,"Taxable Goods","Catalog, Search",10.000000,,,,simple1,Simple1,Simple1,"Simple1 ",,,,,,,,,"6/7/22, 3:15 PM","6/7/22, 3:15 PM",,,"Block after Info Column",,,,"Use config",,,,,,,"Use config","United States",,1000.0000,0.0000,1,0,0,1,1.0000,1,10000.0000,1,1,1.0000,1,1,1,1,1.0000,1,0,0,0,,,,,,,,,,,,,,,,,,,,, -Simple2,,Default,simple,"Default Category",base,Simple2,,,1.000000,1,"Taxable Goods","Catalog, Search",200.000000,,,,simple2,Simple2,Simple2,"Simple2 ",,,,,,,,,"6/7/22, 3:16 PM","6/7/22, 3:16 PM",,,"Block after Info Column",,,,"Use config",,,,,,,"Use config","United States",,1000.0000,0.0000,1,0,0,1,1.0000,1,10000.0000,1,1,1.0000,1,1,1,1,1.0000,1,0,0,0,,,,,,,,,,,,,,,,,,,,, -Simple3,,Default,simple,"Default Category",base,Simple3,,,1.000000,1,"Taxable Goods","Catalog, Search",300.000000,,,,simple3,Simple3,Simple3,"Simple3 ",,,,,,,,,"6/7/22, 3:16 PM","6/7/22, 3:16 PM",,,"Block after Info Column",,,,"Use config",,,,,,,"Use config","United States",,1000.0000,0.0000,1,0,0,1,1.0000,1,10000.0000,1,1,1.0000,1,1,1,1,1.0000,1,0,0,0,,,,,,,,,,,,,,,,,,,,,